From 0d39f477289f4441525ea01007791685d12df524 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Wed, 12 Jan 2022 12:05:59 +0100 Subject: [PATCH] [YAML] Add isLowerCase/isUpperCase/isHexString constraints (#13479) --- .../templates/partials/test_cluster.zapt | 27 +- src/app/tests/suites/TestConstraints.yaml | 71 ++ .../tests/suites/include/ConstraintsChecker.h | 99 +++ src/app/zap-templates/templates/app/helper.js | 6 + .../CHIP/templates/partials/test_cluster.zapt | 45 +- .../Framework/CHIPTests/CHIPClustersTests.m | 729 ++++++++++++++++++ .../chip-tool/zap-generated/test/Commands.h | 409 +++++++++- 7 files changed, 1358 insertions(+), 28 deletions(-) diff --git a/examples/chip-tool/templates/partials/test_cluster.zapt b/examples/chip-tool/templates/partials/test_cluster.zapt index 311b21326b4a2d..360fa4656998a8 100644 --- a/examples/chip-tool/templates/partials/test_cluster.zapt +++ b/examples/chip-tool/templates/partials/test_cluster.zapt @@ -332,18 +332,23 @@ class {{filename}}: public TestCommand {{~#*inline "item"}}{{asLowerCamelCase name}}{{/inline}} VerifyOrReturn(CheckValuePresent("{{> item}}", {{> item}})); {{/if}} - {{#if expectedConstraints.type}}VerifyOrReturn(CheckConstraintType("{{>item}}", "", "{{expectedConstraints.type}}"));{{/if}} - {{~#if expectedConstraints.format}}VerifyOrReturn(CheckConstraintFormat("{{>item}}", "", "{{expectedConstraints.format}}"));{{/if}} - {{~#if expectedConstraints.startsWith}}VerifyOrReturn(CheckConstraintStartsWith("{{>item}}", {{>item}}, "{{expectedConstraints.startsWith}}"));{{/if}} - {{~#if expectedConstraints.endsWith}}VerifyOrReturn(CheckConstraintEndsWith("{{>item}}", {{>item}}, "{{expectedConstraints.endsWith}}"));{{/if}} - {{~#if expectedConstraints.minLength}}VerifyOrReturn(CheckConstraintMinLength("{{>item}}", {{>item}}.size(), {{expectedConstraints.minLength}}));{{/if}} - {{~#if expectedConstraints.maxLength}}VerifyOrReturn(CheckConstraintMaxLength("{{>item}}", {{>item}}.size(), {{expectedConstraints.maxLength}}));{{/if}} - {{~#if expectedConstraints.minValue}}VerifyOrReturn(CheckConstraintMinValue<{{chipType}}>("{{>item}}", {{>item}}, {{asTypedLiteral expectedConstraints.minValue type}}));{{/if}} - {{~#if expectedConstraints.maxValue}}VerifyOrReturn(CheckConstraintMaxValue<{{chipType}}>("{{>item}}", {{>item}}, {{asTypedLiteral expectedConstraints.maxValue type}}));{{/if}} - {{~#if expectedConstraints.notValue}} - VerifyOrReturn(CheckConstraintNotValue("{{>item}}", {{>item}}, {{asTypedLiteral expectedConstraints.notValue type}})); - {{else if (isLiteralNull expectedConstraints.notValue)}} + {{#if (hasProperty expectedConstraints "type")}}VerifyOrReturn(CheckConstraintType("{{>item}}", "", "{{expectedConstraints.type}}"));{{/if}} + {{~#if (hasProperty expectedConstraints "format")}}VerifyOrReturn(CheckConstraintFormat("{{>item}}", "", "{{expectedConstraints.format}}"));{{/if}} + {{~#if (hasProperty expectedConstraints "startsWith")}}VerifyOrReturn(CheckConstraintStartsWith("{{>item}}", {{>item}}, "{{expectedConstraints.startsWith}}"));{{/if}} + {{~#if (hasProperty expectedConstraints "endsWith")}}VerifyOrReturn(CheckConstraintEndsWith("{{>item}}", {{>item}}, "{{expectedConstraints.endsWith}}"));{{/if}} + {{~#if (hasProperty expectedConstraints "isUpperCase")}}VerifyOrReturn(CheckConstraintIsUpperCase("{{>item}}", {{>item}}, {{expectedConstraints.isUpperCase}}));{{/if}} + {{~#if (hasProperty expectedConstraints "isLowerCase")}}VerifyOrReturn(CheckConstraintIsLowerCase("{{>item}}", {{>item}}, {{expectedConstraints.isLowerCase}}));{{/if}} + {{~#if (hasProperty expectedConstraints "isHexString")}}VerifyOrReturn(CheckConstraintIsHexString("{{>item}}", {{>item}}, {{expectedConstraints.isHexString}}));{{/if}} + {{~#if (hasProperty expectedConstraints "minLength")}}VerifyOrReturn(CheckConstraintMinLength("{{>item}}", {{>item}}.size(), {{expectedConstraints.minLength}}));{{/if}} + {{~#if (hasProperty expectedConstraints "maxLength")}}VerifyOrReturn(CheckConstraintMaxLength("{{>item}}", {{>item}}.size(), {{expectedConstraints.maxLength}}));{{/if}} + {{~#if (hasProperty expectedConstraints "minValue")}}VerifyOrReturn(CheckConstraintMinValue<{{chipType}}>("{{>item}}", {{>item}}, {{asTypedLiteral expectedConstraints.minValue type}}));{{/if}} + {{~#if (hasProperty expectedConstraints "maxValue")}}VerifyOrReturn(CheckConstraintMaxValue<{{chipType}}>("{{>item}}", {{>item}}, {{asTypedLiteral expectedConstraints.maxValue type}}));{{/if}} + {{~#if (hasProperty expectedConstraints "notValue")}} + {{#if (isLiteralNull expectedConstraints.notValue)}} VerifyOrReturn(CheckValueNonNull("{{>item}}", {{>item}})); + {{else}} + VerifyOrReturn(CheckConstraintNotValue("{{>item}}", {{>item}}, {{asTypedLiteral expectedConstraints.notValue type}})); + {{/if}} {{/if}} {{/if}} diff --git a/src/app/tests/suites/TestConstraints.yaml b/src/app/tests/suites/TestConstraints.yaml index 017d41a3b79b6c..30ed159b32ce06 100644 --- a/src/app/tests/suites/TestConstraints.yaml +++ b/src/app/tests/suites/TestConstraints.yaml @@ -94,6 +94,77 @@ tests: constraints: endsWith: "**" + - label: "Write attribute CHAR_STRING Value" + command: "writeAttribute" + attribute: "char_string" + arguments: + value: "lowercase" + + - label: + "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints" + command: "readAttribute" + attribute: "char_string" + response: + constraints: + isLowerCase: true + isUpperCase: false + + - label: "Write attribute CHAR_STRING Value" + command: "writeAttribute" + attribute: "char_string" + arguments: + value: "UPPERCASE" + + - label: + "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints" + command: "readAttribute" + attribute: "char_string" + response: + constraints: + isUpperCase: true + isLowerCase: false + + - label: "Write attribute CHAR_STRING Value" + command: "writeAttribute" + attribute: "char_string" + arguments: + value: "lowUPPER" + + - label: + "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints" + command: "readAttribute" + attribute: "char_string" + response: + constraints: + isUpperCase: false + isLowerCase: false + + - label: "Write attribute CHAR_STRING Value" + command: "writeAttribute" + attribute: "char_string" + arguments: + value: "ABCDEF012V" + + - label: "Read attribute CHAR_STRING Value isHexString Constraints" + command: "readAttribute" + attribute: "char_string" + response: + constraints: + isHexString: false + + - label: "Write attribute CHAR_STRING Value" + command: "writeAttribute" + attribute: "char_string" + arguments: + value: "ABCDEF0123" + + - label: "Read attribute CHAR_STRING Value isHexString Constraints" + command: "readAttribute" + attribute: "char_string" + response: + constraints: + isHexString: true + - label: "Write attribute CHAR_STRING Value Back to Default Value" command: "writeAttribute" attribute: "char_string" diff --git a/src/app/tests/suites/include/ConstraintsChecker.h b/src/app/tests/suites/include/ConstraintsChecker.h index 0c44c8b3bbe5d9..43d14134c64c07 100644 --- a/src/app/tests/suites/include/ConstraintsChecker.h +++ b/src/app/tests/suites/include/ConstraintsChecker.h @@ -90,6 +90,105 @@ class ConstraintsChecker return true; } + bool CheckConstraintIsUpperCase(const char * itemName, const chip::CharSpan current, bool expectUpperCase) + { + std::string value(current.data(), current.size()); + return CheckConstraintIsUpperCase(itemName, value.c_str(), expectUpperCase); + } + + bool CheckConstraintIsUpperCase(const char * itemName, const char * current, bool expectUpperCase) + { + bool isUpperCase = true; + for (size_t i = 0; i < strlen(current); i++) + { + if (!isupper(current[i])) + { + isUpperCase = false; + break; + } + } + + if (expectUpperCase && !isUpperCase) + { + Exit(std::string(itemName) + " (\"" + std::string(current) + "\") is not an upppercase string"); + return false; + } + + if (!expectUpperCase && isUpperCase) + { + Exit(std::string(itemName) + " (\"" + std::string(current) + "\") is an upppercase string"); + return false; + } + + return true; + } + + bool CheckConstraintIsLowerCase(const char * itemName, const chip::CharSpan current, bool expectLowerCase) + { + std::string value(current.data(), current.size()); + return CheckConstraintIsLowerCase(itemName, value.c_str(), expectLowerCase); + } + + bool CheckConstraintIsLowerCase(const char * itemName, const char * current, bool expectLowerCase) + { + bool isLowerCase = true; + for (size_t i = 0; i < strlen(current); i++) + { + if (isupper(current[i])) + { + isLowerCase = false; + break; + } + } + + if (expectLowerCase && !isLowerCase) + { + Exit(std::string(itemName) + " (\"" + std::string(current) + "\") is not a lowercase string"); + return false; + } + + if (!expectLowerCase && isLowerCase) + { + Exit(std::string(itemName) + " (\"" + std::string(current) + "\") is a lowercase string"); + return false; + } + + return true; + } + + bool CheckConstraintIsHexString(const char * itemName, const chip::CharSpan current, bool expectHexString) + { + std::string value(current.data(), current.size()); + return CheckConstraintIsHexString(itemName, value.c_str(), expectHexString); + } + + bool CheckConstraintIsHexString(const char * itemName, const char * current, bool expectHexString) + { + bool isHexString = true; + for (size_t i = 0; i < strlen(current); i++) + { + if (!isxdigit(current[i])) + { + isHexString = false; + break; + } + } + + if (expectHexString && !isHexString) + { + Exit(std::string(itemName) + " (\"" + std::string(current) + "\") is not a hexadecimal string"); + return false; + } + + if (!expectHexString && isHexString) + { + Exit(std::string(itemName) + " (\"" + std::string(current) + "\") is a hexadecimal string"); + return false; + } + + return true; + } + template bool CheckConstraintMinValue(const char * itemName, T current, T expected) { diff --git a/src/app/zap-templates/templates/app/helper.js b/src/app/zap-templates/templates/app/helper.js index 1c4bb270720da2..0af4118c78b719 100644 --- a/src/app/zap-templates/templates/app/helper.js +++ b/src/app/zap-templates/templates/app/helper.js @@ -685,6 +685,11 @@ function incrementDepth(depth) return depth + 1; } +function hasProperty(obj, prop) +{ + return prop in obj; +} + // // Module exports // @@ -695,6 +700,7 @@ exports.chip_endpoint_cluster_list = chip_endpoint_cluster_list exports.asTypedLiteral = asTypedLiteral; exports.asLowerCamelCase = asLowerCamelCase; exports.asUpperCamelCase = asUpperCamelCase; +exports.hasProperty = hasProperty; exports.hasSpecificAttributes = hasSpecificAttributes; exports.asMEI = asMEI; exports.zapTypeToEncodableClusterObjectType = zapTypeToEncodableClusterObjectType; diff --git a/src/darwin/Framework/CHIP/templates/partials/test_cluster.zapt b/src/darwin/Framework/CHIP/templates/partials/test_cluster.zapt index 316a1ca1f2a8d9..2dc923a4739c32 100644 --- a/src/darwin/Framework/CHIP/templates/partials/test_cluster.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/test_cluster.zapt @@ -108,31 +108,53 @@ ResponseHandler {{> subscribeDataCallback}} = nil; } {{/if}} {{#if hasExpectedConstraints}} - {{#if expectedConstraints.minLength}} + {{#if (hasProperty expectedConstraints "minLength")}} { {{> actualValue}} XCTAssertGreaterThanOrEqual([actualValue length], {{expectedConstraints.minLength}}); } {{/if}} - {{#if expectedConstraints.startsWith}} + {{#if (hasProperty expectedConstraints "startsWith")}} { {{> actualValue}} XCTAssertTrue([actualValue hasPrefix:@"{{expectedConstraints.startsWith}}"]); } {{/if}} - {{#if expectedConstraints.endsWith}} + {{#if (hasProperty expectedConstraints "endsWith")}} { {{> actualValue}} XCTAssertTrue([actualValue hasSuffix:@"{{expectedConstraints.endsWith}}"]); } {{/if}} - {{#if expectedConstraints.maxLength}} + {{#if (hasProperty expectedConstraints "isLowerCase")}} + { + {{> actualValue}} + BOOL isLowerCase = [actualValue isEqualToString:[actualValue lowercaseString]]; + XCTAssert{{#if expectedConstraints.isLowerCase}}True{{else}}False{{/if}}(isLowerCase); + } + {{/if}} + {{#if (hasProperty expectedConstraints "isUpperCase")}} + { + {{> actualValue}} + BOOL isUpperCase = [actualValue isEqualToString:[actualValue uppercaseString]]; + XCTAssert{{#if expectedConstraints.isUpperCase}}True{{else}}False{{/if}}(isUpperCase); + } + {{/if}} + {{#if (hasProperty expectedConstraints "isHexString")}} + { + {{> actualValue}} + NSCharacterSet *chars = [[NSCharacterSet characterSetWithCharactersInString:@"0123456789ABCDEF"] invertedSet]; + BOOL isHexString = (NSNotFound == [actualValue rangeOfCharacterFromSet:chars].location); + XCTAssert{{#if expectedConstraints.isHexString}}True{{else}}False{{/if}}(isHexString); + } + {{/if}} + {{#if (hasProperty expectedConstraints "maxLength")}} { {{> actualValue}} XCTAssertLessThanOrEqual([actualValue length], {{expectedConstraints.maxLength}}); } {{/if}} - {{#if expectedConstraints.minValue}} + {{#if (hasProperty expectedConstraints "minValue")}} { {{> actualValue}} if (actualValue != nil) { @@ -140,7 +162,7 @@ ResponseHandler {{> subscribeDataCallback}} = nil; } } {{/if}} - {{#if expectedConstraints.maxValue}} + {{#if (hasProperty expectedConstraints "maxValue")}} { {{> actualValue}} if (actualValue != nil) { @@ -148,17 +170,16 @@ ResponseHandler {{> subscribeDataCallback}} = nil; } } {{/if}} - {{#if expectedConstraints.notValue}} + {{#if (hasProperty expectedConstraints "notValue")}} { {{> actualValue}} + {{#if (isLiteralNull expectedConstraints.notValue)}} + XCTAssertFalse(actualValue == nil); + {{else}} if (actualValue != nil) { XCTAssertNotEqual([actualValue {{asObjectiveCNumberType "" type true}}Value], {{asTypedLiteral expectedConstraints.notValue type}}); } - } - {{else if (isLiteralNull expectedConstraints.notValue)}} - { - {{> actualValue}} - XCTAssertFalse(actualValue == nil); + {{/if}} } {{/if}} {{/if}} diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 9de320743c055d..6c5e472199d19d 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -528,6 +528,12 @@ - (void)testSendClusterTest_TC_BI_2_1_000009_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -1085,6 +1091,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000002_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -1181,6 +1193,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000006_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -1278,6 +1296,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000010_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -1373,6 +1397,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000014_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -1446,6 +1476,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000017_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -1472,6 +1508,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000018_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -2180,6 +2222,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000049_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -2278,6 +2326,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000053_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -2380,6 +2434,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000057_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -2551,6 +2611,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000063_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -2672,6 +2738,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000067_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -2760,6 +2832,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000070_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -2929,6 +3007,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000076_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -3001,6 +3085,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000079_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -3072,6 +3162,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000082_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -3162,6 +3258,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000086_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -3233,6 +3335,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000089_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -3323,6 +3431,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000093_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -3394,6 +3508,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000096_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -3484,6 +3604,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000100_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -3555,6 +3681,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000103_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -3645,6 +3777,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000107_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -3716,6 +3854,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000110_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -3806,6 +3950,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000114_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -3877,6 +4027,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000117_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -3972,6 +4128,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000121_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -4059,6 +4221,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000124_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -4146,6 +4314,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000127_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -4233,6 +4407,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000130_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -4401,6 +4581,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000136_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -4488,6 +4674,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000139_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -4656,6 +4848,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000145_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -4743,6 +4941,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000148_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -10503,6 +10707,12 @@ - (void)testSendClusterTest_TC_FLW_2_1_000011_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -12004,6 +12214,12 @@ - (void)testSendClusterTest_TC_OCC_2_1_000001_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -12077,6 +12293,12 @@ - (void)testSendClusterTest_TC_OCC_2_1_000004_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -16183,6 +16405,12 @@ - (void)testSendClusterTest_TC_RH_2_1_000002_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -16247,6 +16475,12 @@ - (void)testSendClusterTest_TC_RH_2_1_000004_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -16468,6 +16702,12 @@ - (void)testSendClusterTest_TC_TM_2_1_000002_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -17751,6 +17991,12 @@ - (void)testSendClusterTest_TC_TSTAT_2_1_000043_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -17853,6 +18099,12 @@ - (void)testSendClusterTest_TC_TSTAT_2_1_000047_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -17962,6 +18214,12 @@ - (void)testSendClusterTest_TC_TSTAT_2_1_000051_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue charValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -18054,6 +18312,12 @@ - (void)testSendClusterTest_TC_TSTAT_2_1_000054_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -20322,6 +20586,12 @@ - (void)testSendClusterTest_TC_WNCV_1_1_000004_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedIntValue], 0UL); + } + } { id actualValue = value; if (actualValue != nil) { @@ -20405,6 +20675,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000001_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -20478,6 +20754,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000004_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -20553,6 +20835,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000007_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -20630,6 +20918,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000010_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -20706,6 +21000,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000013_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -20780,6 +21080,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000016_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -20861,6 +21167,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000019_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -20942,6 +21254,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000022_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -21023,6 +21341,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000025_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -21103,6 +21427,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000028_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -21155,6 +21485,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000030_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -21182,6 +21518,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000031_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -21234,6 +21576,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000033_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -21261,6 +21609,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000034_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -21313,6 +21667,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000036_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -21340,6 +21700,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000037_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -21392,6 +21758,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000039_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -21418,6 +21790,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000040_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -21493,6 +21871,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000043_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -21544,6 +21928,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000045_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -21571,6 +21961,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000046_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -21622,6 +22018,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000048_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -21650,6 +22052,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000049_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -21731,6 +22139,12 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000052_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -21852,6 +22266,12 @@ - (void)testSendClusterTest_TC_WNCV_2_4_000002_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -21911,6 +22331,12 @@ - (void)testSendClusterTest_TC_WNCV_2_5_000002_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -27808,6 +28234,12 @@ - (void)testSendClusterTestCluster_000214_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -27882,6 +28314,12 @@ - (void)testSendClusterTestCluster_000217_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } { id actualValue = value; if (actualValue != nil) { @@ -28121,6 +28559,12 @@ - (void)testSendClusterTestCluster_000227_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -28195,6 +28639,12 @@ - (void)testSendClusterTestCluster_000230_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } { id actualValue = value; if (actualValue != nil) { @@ -28434,6 +28884,12 @@ - (void)testSendClusterTestCluster_000240_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedIntValue], 0UL); + } + } { id actualValue = value; if (actualValue != nil) { @@ -28508,6 +28964,12 @@ - (void)testSendClusterTestCluster_000243_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedIntValue], 0UL); + } + } { id actualValue = value; if (actualValue != nil) { @@ -28747,6 +29209,12 @@ - (void)testSendClusterTestCluster_000253_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedLongLongValue], 0ULL); + } + } { id actualValue = value; if (actualValue != nil) { @@ -28821,6 +29289,12 @@ - (void)testSendClusterTestCluster_000256_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedLongLongValue], 0ULL); + } + } { id actualValue = value; if (actualValue != nil) { @@ -36636,6 +37110,261 @@ - (void)testSendClusterTestConstraints_000010_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterTestConstraints_000011_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id charStringArgument; + charStringArgument = @"lowercase"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestConstraints_000012_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + BOOL isLowerCase = [actualValue isEqualToString:[actualValue lowercaseString]]; + XCTAssertTrue(isLowerCase); + } + { + id actualValue = value; + BOOL isUpperCase = [actualValue isEqualToString:[actualValue uppercaseString]]; + XCTAssertFalse(isUpperCase); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestConstraints_000013_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id charStringArgument; + charStringArgument = @"UPPERCASE"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestConstraints_000014_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + BOOL isLowerCase = [actualValue isEqualToString:[actualValue lowercaseString]]; + XCTAssertFalse(isLowerCase); + } + { + id actualValue = value; + BOOL isUpperCase = [actualValue isEqualToString:[actualValue uppercaseString]]; + XCTAssertTrue(isUpperCase); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestConstraints_000015_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id charStringArgument; + charStringArgument = @"lowUPPER"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestConstraints_000016_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + BOOL isLowerCase = [actualValue isEqualToString:[actualValue lowercaseString]]; + XCTAssertFalse(isLowerCase); + } + { + id actualValue = value; + BOOL isUpperCase = [actualValue isEqualToString:[actualValue uppercaseString]]; + XCTAssertFalse(isUpperCase); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestConstraints_000017_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id charStringArgument; + charStringArgument = @"ABCDEF012V"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestConstraints_000018_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING Value isHexString Constraints"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value isHexString Constraints Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + NSCharacterSet * chars = [[NSCharacterSet characterSetWithCharactersInString:@"0123456789ABCDEF"] invertedSet]; + BOOL isHexString = (NSNotFound == [actualValue rangeOfCharacterFromSet:chars].location); + XCTAssertFalse(isHexString); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestConstraints_000019_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id charStringArgument; + charStringArgument = @"ABCDEF0123"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestConstraints_000020_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING Value isHexString Constraints"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value isHexString Constraints Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + NSCharacterSet * chars = [[NSCharacterSet characterSetWithCharactersInString:@"0123456789ABCDEF"] invertedSet]; + BOOL isHexString = (NSNotFound == [actualValue rangeOfCharacterFromSet:chars].location); + XCTAssertTrue(isHexString); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestConstraints_000021_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING Value Back to Default Value"]; diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index cfb3300af70475..50bffa05251424 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -743,6 +743,7 @@ class Test_TC_BI_2_1 : public TestCommand void OnSuccessResponse_9(uint8_t statusFlags) { VerifyOrReturn(CheckConstraintType("statusFlags", "", "map8")); + VerifyOrReturn(CheckConstraintMinValue("statusFlags", statusFlags, 0)); VerifyOrReturn(CheckConstraintMaxValue("statusFlags", statusFlags, 15)); NextTest(); } @@ -3821,6 +3822,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_2(uint8_t currentHue) { VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("currentHue", currentHue, 0)); VerifyOrReturn(CheckConstraintMaxValue("currentHue", currentHue, 254)); NextTest(); } @@ -3903,6 +3905,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_6(uint8_t currentSaturation) { VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", currentSaturation, 0)); VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", currentSaturation, 254)); NextTest(); } @@ -3985,6 +3988,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_10(uint16_t currentX) { VerifyOrReturn(CheckConstraintType("currentX", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("currentX", currentX, 0U)); VerifyOrReturn(CheckConstraintMaxValue("currentX", currentX, 65279U)); NextTest(); } @@ -4067,6 +4071,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_14(uint16_t currentY) { VerifyOrReturn(CheckConstraintType("currentY", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("currentY", currentY, 0U)); VerifyOrReturn(CheckConstraintMaxValue("currentY", currentY, 65279U)); NextTest(); } @@ -4129,6 +4134,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_17(uint16_t colorTemperature) { VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", colorTemperature, 0U)); VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", colorTemperature, 65279U)); NextTest(); } @@ -4149,6 +4155,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_18(uint8_t colorMode) { VerifyOrReturn(CheckConstraintType("colorMode", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("colorMode", colorMode, 0)); VerifyOrReturn(CheckConstraintMaxValue("colorMode", colorMode, 2)); NextTest(); } @@ -4779,6 +4786,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_49(uint16_t colorCapabilities) { VerifyOrReturn(CheckConstraintType("colorCapabilities", "", "map16")); + VerifyOrReturn(CheckConstraintMinValue("colorCapabilities", colorCapabilities, 0U)); VerifyOrReturn(CheckConstraintMaxValue("colorCapabilities", colorCapabilities, 65279U)); NextTest(); } @@ -4861,6 +4869,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_53(uint16_t colorTempPhysicalMin) { VerifyOrReturn(CheckConstraintType("colorTempPhysicalMin", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("colorTempPhysicalMin", colorTempPhysicalMin, 0U)); VerifyOrReturn(CheckConstraintMaxValue("colorTempPhysicalMin", colorTempPhysicalMin, 65279U)); NextTest(); } @@ -4943,6 +4952,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_57(uint16_t colorTempPhysicalMax) { VerifyOrReturn(CheckConstraintType("colorTempPhysicalMax", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("colorTempPhysicalMax", colorTempPhysicalMax, 0U)); VerifyOrReturn(CheckConstraintMaxValue("colorTempPhysicalMax", colorTempPhysicalMax, 65279U)); NextTest(); } @@ -5079,6 +5089,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_63(uint16_t startUpColorTemperatureMireds) { VerifyOrReturn(CheckConstraintType("startUpColorTemperatureMireds", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("startUpColorTemperatureMireds", startUpColorTemperatureMireds, 0U)); VerifyOrReturn(CheckConstraintMaxValue("startUpColorTemperatureMireds", startUpColorTemperatureMireds, 65279U)); NextTest(); } @@ -5171,6 +5182,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_67(uint16_t remainingTime) { VerifyOrReturn(CheckConstraintType("remainingTime", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("remainingTime", remainingTime, 0U)); VerifyOrReturn(CheckConstraintMaxValue("remainingTime", remainingTime, 254U)); NextTest(); } @@ -5239,6 +5251,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_70(uint8_t driftCompensation) { VerifyOrReturn(CheckConstraintType("driftCompensation", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("driftCompensation", driftCompensation, 0)); VerifyOrReturn(CheckConstraintMaxValue("driftCompensation", driftCompensation, 4)); NextTest(); } @@ -5372,6 +5385,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_76(uint8_t numberOfPrimaries) { VerifyOrReturn(CheckConstraintType("numberOfPrimaries", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("numberOfPrimaries", numberOfPrimaries, 0)); VerifyOrReturn(CheckConstraintMaxValue("numberOfPrimaries", numberOfPrimaries, 6)); NextTest(); } @@ -5434,6 +5448,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_79(uint16_t primary1X) { VerifyOrReturn(CheckConstraintType("primary1X", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary1X", primary1X, 0U)); VerifyOrReturn(CheckConstraintMaxValue("primary1X", primary1X, 65279U)); NextTest(); } @@ -5496,6 +5511,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_82(uint16_t primary1Y) { VerifyOrReturn(CheckConstraintType("primary1Y", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary1Y", primary1Y, 0U)); VerifyOrReturn(CheckConstraintMaxValue("primary1Y", primary1Y, 65279U)); NextTest(); } @@ -5577,6 +5593,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_86(uint16_t primary2X) { VerifyOrReturn(CheckConstraintType("primary2X", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary2X", primary2X, 0U)); VerifyOrReturn(CheckConstraintMaxValue("primary2X", primary2X, 65279U)); NextTest(); } @@ -5639,6 +5656,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_89(uint16_t primary2Y) { VerifyOrReturn(CheckConstraintType("primary2Y", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary2Y", primary2Y, 0U)); VerifyOrReturn(CheckConstraintMaxValue("primary2Y", primary2Y, 65279U)); NextTest(); } @@ -5720,6 +5738,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_93(uint16_t primary3X) { VerifyOrReturn(CheckConstraintType("primary3X", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary3X", primary3X, 0U)); VerifyOrReturn(CheckConstraintMaxValue("primary3X", primary3X, 65279U)); NextTest(); } @@ -5782,6 +5801,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_96(uint16_t primary3Y) { VerifyOrReturn(CheckConstraintType("primary3Y", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary3Y", primary3Y, 0U)); VerifyOrReturn(CheckConstraintMaxValue("primary3Y", primary3Y, 65279U)); NextTest(); } @@ -5863,6 +5883,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_100(uint16_t primary4X) { VerifyOrReturn(CheckConstraintType("primary4X", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary4X", primary4X, 0U)); VerifyOrReturn(CheckConstraintMaxValue("primary4X", primary4X, 65279U)); NextTest(); } @@ -5925,6 +5946,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_103(uint16_t primary4Y) { VerifyOrReturn(CheckConstraintType("primary4Y", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary4Y", primary4Y, 0U)); VerifyOrReturn(CheckConstraintMaxValue("primary4Y", primary4Y, 65279U)); NextTest(); } @@ -6006,6 +6028,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_107(uint16_t primary5X) { VerifyOrReturn(CheckConstraintType("primary5X", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary5X", primary5X, 0U)); VerifyOrReturn(CheckConstraintMaxValue("primary5X", primary5X, 65279U)); NextTest(); } @@ -6068,6 +6091,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_110(uint16_t primary5Y) { VerifyOrReturn(CheckConstraintType("primary5Y", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary5Y", primary5Y, 0U)); VerifyOrReturn(CheckConstraintMaxValue("primary5Y", primary5Y, 65279U)); NextTest(); } @@ -6149,6 +6173,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_114(uint16_t primary6X) { VerifyOrReturn(CheckConstraintType("primary6X", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary6X", primary6X, 0U)); VerifyOrReturn(CheckConstraintMaxValue("primary6X", primary6X, 65279U)); NextTest(); } @@ -6211,6 +6236,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_117(uint16_t primary6Y) { VerifyOrReturn(CheckConstraintType("primary6Y", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary6Y", primary6Y, 0U)); VerifyOrReturn(CheckConstraintMaxValue("primary6Y", primary6Y, 65279U)); NextTest(); } @@ -6295,6 +6321,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_121(uint16_t whitePointX) { VerifyOrReturn(CheckConstraintType("whitePointX", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("whitePointX", whitePointX, 0U)); VerifyOrReturn(CheckConstraintMaxValue("whitePointX", whitePointX, 65279U)); NextTest(); } @@ -6362,6 +6389,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_124(uint16_t whitePointY) { VerifyOrReturn(CheckConstraintType("whitePointY", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("whitePointY", whitePointY, 0U)); VerifyOrReturn(CheckConstraintMaxValue("whitePointY", whitePointY, 65279U)); NextTest(); } @@ -6429,6 +6457,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_127(uint16_t colorPointRX) { VerifyOrReturn(CheckConstraintType("colorPointRX", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("colorPointRX", colorPointRX, 0U)); VerifyOrReturn(CheckConstraintMaxValue("colorPointRX", colorPointRX, 65279U)); NextTest(); } @@ -6496,6 +6525,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_130(uint16_t colorPointRY) { VerifyOrReturn(CheckConstraintType("colorPointRY", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("colorPointRY", colorPointRY, 0U)); VerifyOrReturn(CheckConstraintMaxValue("colorPointRY", colorPointRY, 65279U)); NextTest(); } @@ -6629,6 +6659,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_136(uint16_t colorPointGX) { VerifyOrReturn(CheckConstraintType("colorPointGX", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("colorPointGX", colorPointGX, 0U)); VerifyOrReturn(CheckConstraintMaxValue("colorPointGX", colorPointGX, 65279U)); NextTest(); } @@ -6696,6 +6727,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_139(uint16_t colorPointGY) { VerifyOrReturn(CheckConstraintType("colorPointGY", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("colorPointGY", colorPointGY, 0U)); VerifyOrReturn(CheckConstraintMaxValue("colorPointGY", colorPointGY, 65279U)); NextTest(); } @@ -6829,6 +6861,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_145(uint16_t colorPointBX) { VerifyOrReturn(CheckConstraintType("colorPointBX", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("colorPointBX", colorPointBX, 0U)); VerifyOrReturn(CheckConstraintMaxValue("colorPointBX", colorPointBX, 65279U)); NextTest(); } @@ -6896,6 +6929,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_148(uint16_t colorPointBY) { VerifyOrReturn(CheckConstraintType("colorPointBY", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("colorPointBY", colorPointBY, 0U)); VerifyOrReturn(CheckConstraintMaxValue("colorPointBY", colorPointBY, 65279U)); NextTest(); } @@ -16805,6 +16839,7 @@ class Test_TC_FLW_2_1 : public TestCommand void OnSuccessResponse_11(uint16_t tolerance) { VerifyOrReturn(CheckConstraintType("tolerance", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("tolerance", tolerance, 0U)); VerifyOrReturn(CheckConstraintMaxValue("tolerance", tolerance, 2048U)); NextTest(); } @@ -20103,6 +20138,7 @@ class Test_TC_OCC_2_1 : public TestCommand void OnSuccessResponse_1(uint8_t occupancy) { VerifyOrReturn(CheckConstraintType("occupancy", "", "map8")); + VerifyOrReturn(CheckConstraintMinValue("occupancy", occupancy, 0)); VerifyOrReturn(CheckConstraintMaxValue("occupancy", occupancy, 1)); NextTest(); } @@ -20166,6 +20202,7 @@ class Test_TC_OCC_2_1 : public TestCommand void OnSuccessResponse_4(uint8_t occupancySensorType) { VerifyOrReturn(CheckConstraintType("occupancySensorType", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("occupancySensorType", occupancySensorType, 0)); VerifyOrReturn(CheckConstraintMaxValue("occupancySensorType", occupancySensorType, 3)); NextTest(); } @@ -26885,6 +26922,7 @@ class Test_TC_RH_2_1 : public TestCommand void OnSuccessResponse_2(uint16_t minMeasuredValue) { VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", minMeasuredValue, 0U)); VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", minMeasuredValue, 9999U)); NextTest(); } @@ -26933,6 +26971,7 @@ class Test_TC_RH_2_1 : public TestCommand void OnSuccessResponse_4(uint16_t tolerance) { VerifyOrReturn(CheckConstraintType("tolerance", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("tolerance", tolerance, 0U)); VerifyOrReturn(CheckConstraintMaxValue("tolerance", tolerance, 2048U)); NextTest(); } @@ -27416,6 +27455,7 @@ class Test_TC_TM_2_1 : public TestCommand void OnSuccessResponse_2(uint16_t tolerance) { VerifyOrReturn(CheckConstraintType("tolerance", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("tolerance", tolerance, 0U)); VerifyOrReturn(CheckConstraintMaxValue("tolerance", tolerance, 2048U)); NextTest(); } @@ -29494,6 +29534,7 @@ class Test_TC_TSTAT_2_1 : public TestCommand void OnSuccessResponse_43(uint8_t controlSequenceOfOperation) { VerifyOrReturn(CheckConstraintType("controlSequenceOfOperation", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("controlSequenceOfOperation", controlSequenceOfOperation, 0)); VerifyOrReturn(CheckConstraintMaxValue("controlSequenceOfOperation", controlSequenceOfOperation, 5)); NextTest(); } @@ -29574,6 +29615,7 @@ class Test_TC_TSTAT_2_1 : public TestCommand void OnSuccessResponse_47(uint8_t systemMode) { VerifyOrReturn(CheckConstraintType("systemMode", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("systemMode", systemMode, 0)); VerifyOrReturn(CheckConstraintMaxValue("systemMode", systemMode, 9)); NextTest(); } @@ -29658,6 +29700,7 @@ class Test_TC_TSTAT_2_1 : public TestCommand void OnSuccessResponse_51(int8_t minSetpointDeadBand) { VerifyOrReturn(CheckConstraintType("minSetpointDeadBand", "", "int8")); + VerifyOrReturn(CheckConstraintMinValue("minSetpointDeadBand", minSetpointDeadBand, 0)); VerifyOrReturn(CheckConstraintMaxValue("minSetpointDeadBand", minSetpointDeadBand, 25)); NextTest(); } @@ -29725,6 +29768,7 @@ class Test_TC_TSTAT_2_1 : public TestCommand void OnSuccessResponse_54(uint8_t startOfWeek) { VerifyOrReturn(CheckConstraintType("startOfWeek", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("startOfWeek", startOfWeek, 0)); VerifyOrReturn(CheckConstraintMaxValue("startOfWeek", startOfWeek, 6)); NextTest(); } @@ -33300,6 +33344,7 @@ class Test_TC_WNCV_1_1 : public TestCommand void OnSuccessResponse_4(uint32_t featureMap) { VerifyOrReturn(CheckConstraintType("featureMap", "", "uint32")); + VerifyOrReturn(CheckConstraintMinValue("featureMap", featureMap, 0UL)); VerifyOrReturn(CheckConstraintMaxValue("featureMap", featureMap, 32768UL)); NextTest(); } @@ -34175,6 +34220,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_1(uint8_t type) { VerifyOrReturn(CheckConstraintType("type", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("type", type, 0)); VerifyOrReturn(CheckConstraintMaxValue("type", type, 9)); NextTest(); } @@ -34238,6 +34284,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_4(uint8_t configStatus) { VerifyOrReturn(CheckConstraintType("configStatus", "", "map8")); + VerifyOrReturn(CheckConstraintMinValue("configStatus", configStatus, 0)); VerifyOrReturn(CheckConstraintMaxValue("configStatus", configStatus, 63)); NextTest(); } @@ -34301,6 +34348,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_7(uint8_t operationalStatus) { VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); + VerifyOrReturn(CheckConstraintMinValue("operationalStatus", operationalStatus, 0)); VerifyOrReturn(CheckConstraintMaxValue("operationalStatus", operationalStatus, 63)); NextTest(); } @@ -34364,6 +34412,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_10(uint8_t endProductType) { VerifyOrReturn(CheckConstraintType("endProductType", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("endProductType", endProductType, 0)); VerifyOrReturn(CheckConstraintMaxValue("endProductType", endProductType, 23)); NextTest(); } @@ -34427,6 +34476,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_13(uint8_t mode) { VerifyOrReturn(CheckConstraintType("mode", "", "map8")); + VerifyOrReturn(CheckConstraintMinValue("mode", mode, 0)); VerifyOrReturn(CheckConstraintMaxValue("mode", mode, 15)); NextTest(); } @@ -34486,6 +34536,8 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_16(const chip::app::DataModel::Nullable & targetPositionLiftPercent100ths) { VerifyOrReturn(CheckConstraintType("targetPositionLiftPercent100ths", "", "Percent100ths")); + VerifyOrReturn( + CheckConstraintMinValue("targetPositionLiftPercent100ths", targetPositionLiftPercent100ths, 0U)); VerifyOrReturn(CheckConstraintMaxValue("targetPositionLiftPercent100ths", targetPositionLiftPercent100ths, 10000U)); NextTest(); @@ -34554,6 +34606,8 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_19(const chip::app::DataModel::Nullable & targetPositionTiltPercent100ths) { VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "Percent100ths")); + VerifyOrReturn( + CheckConstraintMinValue("targetPositionTiltPercent100ths", targetPositionTiltPercent100ths, 0U)); VerifyOrReturn(CheckConstraintMaxValue("targetPositionTiltPercent100ths", targetPositionTiltPercent100ths, 10000U)); NextTest(); @@ -34622,6 +34676,8 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_22(const chip::app::DataModel::Nullable & currentPositionLiftPercent100ths) { VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "Percent100ths")); + VerifyOrReturn( + CheckConstraintMinValue("currentPositionLiftPercent100ths", currentPositionLiftPercent100ths, 0U)); VerifyOrReturn(CheckConstraintMaxValue("currentPositionLiftPercent100ths", currentPositionLiftPercent100ths, 10000U)); NextTest(); @@ -34690,6 +34746,8 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_25(const chip::app::DataModel::Nullable & currentPositionTiltPercent100ths) { VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "Percent100ths")); + VerifyOrReturn( + CheckConstraintMinValue("currentPositionTiltPercent100ths", currentPositionTiltPercent100ths, 0U)); VerifyOrReturn(CheckConstraintMaxValue("currentPositionTiltPercent100ths", currentPositionTiltPercent100ths, 10000U)); NextTest(); @@ -34758,6 +34816,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_28(uint16_t installedOpenLimitLift) { VerifyOrReturn(CheckConstraintType("installedOpenLimitLift", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("installedOpenLimitLift", installedOpenLimitLift, 0U)); VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitLift", installedOpenLimitLift, 65535U)); NextTest(); } @@ -34802,6 +34861,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_30(uint16_t installedOpenLimitLift) { VerifyOrReturn(CheckConstraintType("installedOpenLimitLift", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("installedOpenLimitLift", installedOpenLimitLift, 0U)); VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitLift", installedOpenLimitLift, 65535U)); NextTest(); } @@ -34823,6 +34883,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_31(uint16_t installedClosedLimitLift) { VerifyOrReturn(CheckConstraintType("installedClosedLimitLift", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("installedClosedLimitLift", installedClosedLimitLift, 0U)); VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitLift", installedClosedLimitLift, 65535U)); NextTest(); } @@ -34867,6 +34928,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_33(uint16_t installedClosedLimitLift) { VerifyOrReturn(CheckConstraintType("installedClosedLimitLift", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("installedClosedLimitLift", installedClosedLimitLift, 0U)); VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitLift", installedClosedLimitLift, 65535U)); NextTest(); } @@ -34888,6 +34950,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_34(uint16_t installedOpenLimitTilt) { VerifyOrReturn(CheckConstraintType("installedOpenLimitTilt", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("installedOpenLimitTilt", installedOpenLimitTilt, 0U)); VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitTilt", installedOpenLimitTilt, 65535U)); NextTest(); } @@ -34932,6 +34995,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_36(uint16_t installedOpenLimitTilt) { VerifyOrReturn(CheckConstraintType("installedOpenLimitTilt", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("installedOpenLimitTilt", installedOpenLimitTilt, 0U)); VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitTilt", installedOpenLimitTilt, 65535U)); NextTest(); } @@ -34953,6 +35017,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_37(uint16_t installedClosedLimitTilt) { VerifyOrReturn(CheckConstraintType("installedClosedLimitTilt", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("installedClosedLimitTilt", installedClosedLimitTilt, 0U)); VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitTilt", installedClosedLimitTilt, 65535U)); NextTest(); } @@ -34997,6 +35062,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_39(uint16_t installedClosedLimitTilt) { VerifyOrReturn(CheckConstraintType("installedClosedLimitTilt", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("installedClosedLimitTilt", installedClosedLimitTilt, 0U)); VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitTilt", installedClosedLimitTilt, 65535U)); NextTest(); } @@ -35017,6 +35083,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_40(uint16_t safetyStatus) { VerifyOrReturn(CheckConstraintType("safetyStatus", "", "map16")); + VerifyOrReturn(CheckConstraintMinValue("safetyStatus", safetyStatus, 0U)); VerifyOrReturn(CheckConstraintMaxValue("safetyStatus", safetyStatus, 2047U)); NextTest(); } @@ -35080,6 +35147,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_43(const chip::app::DataModel::Nullable & currentPositionLift) { VerifyOrReturn(CheckConstraintType("currentPositionLift", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("currentPositionLift", currentPositionLift, 0U)); VerifyOrReturn(CheckConstraintMaxValue("currentPositionLift", currentPositionLift, 65535U)); NextTest(); } @@ -35123,6 +35191,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_45(const chip::app::DataModel::Nullable & currentPositionLift) { VerifyOrReturn(CheckConstraintType("currentPositionLift", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("currentPositionLift", currentPositionLift, 0U)); VerifyOrReturn(CheckConstraintMaxValue("currentPositionLift", currentPositionLift, 65535U)); NextTest(); } @@ -35143,6 +35212,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_46(const chip::app::DataModel::Nullable & currentPositionTilt) { VerifyOrReturn(CheckConstraintType("currentPositionTilt", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("currentPositionTilt", currentPositionTilt, 0U)); VerifyOrReturn(CheckConstraintMaxValue("currentPositionTilt", currentPositionTilt, 65535U)); NextTest(); } @@ -35186,6 +35256,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_48(const chip::app::DataModel::Nullable & currentPositionTilt) { VerifyOrReturn(CheckConstraintType("currentPositionTilt", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("currentPositionTilt", currentPositionTilt, 0U)); VerifyOrReturn(CheckConstraintMaxValue("currentPositionTilt", currentPositionTilt, 65535U)); NextTest(); } @@ -35207,6 +35278,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_49(const chip::app::DataModel::Nullable & currentPositionLiftPercentage) { VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "Percent")); + VerifyOrReturn(CheckConstraintMinValue("currentPositionLiftPercentage", currentPositionLiftPercentage, 0)); VerifyOrReturn(CheckConstraintMaxValue("currentPositionLiftPercentage", currentPositionLiftPercentage, 100)); NextTest(); } @@ -35274,6 +35346,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_52(const chip::app::DataModel::Nullable & currentPositionTiltPercentage) { VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "Percent")); + VerifyOrReturn(CheckConstraintMinValue("currentPositionTiltPercentage", currentPositionTiltPercentage, 0)); VerifyOrReturn(CheckConstraintMaxValue("currentPositionTiltPercentage", currentPositionTiltPercentage, 100)); NextTest(); } @@ -35528,6 +35601,7 @@ class Test_TC_WNCV_2_4 : public TestCommand void OnSuccessResponse_2(uint8_t type) { VerifyOrReturn(CheckConstraintType("type", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("type", type, 0)); VerifyOrReturn(CheckConstraintMaxValue("type", type, 9)); NextTest(); } @@ -35671,6 +35745,7 @@ class Test_TC_WNCV_2_5 : public TestCommand void OnSuccessResponse_2(uint8_t endProductType) { VerifyOrReturn(CheckConstraintType("endProductType", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("endProductType", endProductType, 0)); VerifyOrReturn(CheckConstraintMaxValue("endProductType", endProductType, 23)); NextTest(); } @@ -49728,6 +49803,7 @@ class TestCluster : public TestCommand void OnSuccessResponse_214(const chip::app::DataModel::Nullable & nullableInt8u) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt8u", nullableInt8u, 0)); VerifyOrReturn(CheckConstraintMaxValue("nullableInt8u", nullableInt8u, 254)); NextTest(); } @@ -49786,6 +49862,7 @@ class TestCluster : public TestCommand void OnSuccessResponse_217(const chip::app::DataModel::Nullable & nullableInt8u) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt8u", nullableInt8u, 0)); VerifyOrReturn(CheckConstraintMaxValue("nullableInt8u", nullableInt8u, 254)); NextTest(); } @@ -49987,6 +50064,7 @@ class TestCluster : public TestCommand void OnSuccessResponse_227(const chip::app::DataModel::Nullable & nullableInt16u) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt16u", nullableInt16u, 0U)); VerifyOrReturn(CheckConstraintMaxValue("nullableInt16u", nullableInt16u, 65534U)); NextTest(); } @@ -50045,6 +50123,7 @@ class TestCluster : public TestCommand void OnSuccessResponse_230(const chip::app::DataModel::Nullable & nullableInt16u) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt16u", nullableInt16u, 0U)); VerifyOrReturn(CheckConstraintMaxValue("nullableInt16u", nullableInt16u, 65534U)); NextTest(); } @@ -50246,6 +50325,7 @@ class TestCluster : public TestCommand void OnSuccessResponse_240(const chip::app::DataModel::Nullable & nullableInt32u) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt32u", nullableInt32u, 0UL)); VerifyOrReturn(CheckConstraintMaxValue("nullableInt32u", nullableInt32u, 4294967294UL)); NextTest(); } @@ -50304,6 +50384,7 @@ class TestCluster : public TestCommand void OnSuccessResponse_243(const chip::app::DataModel::Nullable & nullableInt32u) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt32u", nullableInt32u, 0UL)); VerifyOrReturn(CheckConstraintMaxValue("nullableInt32u", nullableInt32u, 4294967294UL)); NextTest(); } @@ -50505,6 +50586,7 @@ class TestCluster : public TestCommand void OnSuccessResponse_253(const chip::app::DataModel::Nullable & nullableInt64u) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt64u", nullableInt64u, 0ULL)); VerifyOrReturn(CheckConstraintMaxValue("nullableInt64u", nullableInt64u, 18446744073709551614ULL)); NextTest(); } @@ -50563,6 +50645,7 @@ class TestCluster : public TestCommand void OnSuccessResponse_256(const chip::app::DataModel::Nullable & nullableInt64u) { + VerifyOrReturn(CheckConstraintMinValue("nullableInt64u", nullableInt64u, 0ULL)); VerifyOrReturn(CheckConstraintMaxValue("nullableInt64u", nullableInt64u, 18446744073709551614ULL)); NextTest(); } @@ -55871,8 +55954,51 @@ class TestConstraints : public TestCommand err = TestReadAttributeCharStringValueEndsWithConstraints_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Write attribute CHAR_STRING Value Back to Default Value\n"); - err = TestWriteAttributeCharStringValueBackToDefaultValue_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_11(); + break; + case 12: + ChipLogProgress(chipTool, + " ***** Test Step 12 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); + err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_13(); + break; + case 14: + ChipLogProgress(chipTool, + " ***** Test Step 14 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); + err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); + err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Read attribute CHAR_STRING Value isHexString Constraints\n"); + err = TestReadAttributeCharStringValueIsHexStringConstraints_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Read attribute CHAR_STRING Value isHexString Constraints\n"); + err = TestReadAttributeCharStringValueIsHexStringConstraints_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Write attribute CHAR_STRING Value Back to Default Value\n"); + err = TestWriteAttributeCharStringValueBackToDefaultValue_21(); break; } @@ -55885,7 +56011,7 @@ class TestConstraints : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 12; + const uint16_t mTestCount = 22; chip::Optional mCluster; chip::Optional mEndpoint; @@ -55988,6 +56114,91 @@ class TestConstraints : public TestCommand static void OnSuccessCallback_11(void * context) { (static_cast(context))->OnSuccessResponse_11(); } + static void OnFailureCallback_12(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_12(status); + } + + static void OnSuccessCallback_12(void * context, chip::CharSpan charString) + { + (static_cast(context))->OnSuccessResponse_12(charString); + } + + static void OnFailureCallback_13(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_13(status); + } + + static void OnSuccessCallback_13(void * context) { (static_cast(context))->OnSuccessResponse_13(); } + + static void OnFailureCallback_14(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_14(status); + } + + static void OnSuccessCallback_14(void * context, chip::CharSpan charString) + { + (static_cast(context))->OnSuccessResponse_14(charString); + } + + static void OnFailureCallback_15(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_15(status); + } + + static void OnSuccessCallback_15(void * context) { (static_cast(context))->OnSuccessResponse_15(); } + + static void OnFailureCallback_16(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_16(status); + } + + static void OnSuccessCallback_16(void * context, chip::CharSpan charString) + { + (static_cast(context))->OnSuccessResponse_16(charString); + } + + static void OnFailureCallback_17(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_17(status); + } + + static void OnSuccessCallback_17(void * context) { (static_cast(context))->OnSuccessResponse_17(); } + + static void OnFailureCallback_18(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_18(status); + } + + static void OnSuccessCallback_18(void * context, chip::CharSpan charString) + { + (static_cast(context))->OnSuccessResponse_18(charString); + } + + static void OnFailureCallback_19(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_19(status); + } + + static void OnSuccessCallback_19(void * context) { (static_cast(context))->OnSuccessResponse_19(); } + + static void OnFailureCallback_20(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_20(status); + } + + static void OnSuccessCallback_20(void * context, chip::CharSpan charString) + { + (static_cast(context))->OnSuccessResponse_20(charString); + } + + static void OnFailureCallback_21(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_21(status); + } + + static void OnSuccessCallback_21(void * context) { (static_cast(context))->OnSuccessResponse_21(); } + // // Tests methods // @@ -56186,14 +56397,14 @@ class TestConstraints : public TestCommand NextTest(); } - CHIP_ERROR TestWriteAttributeCharStringValueBackToDefaultValue_11() + CHIP_ERROR TestWriteAttributeCharStringValue_11() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); chip::CharSpan charStringArgument; - charStringArgument = chip::Span("garbage: not in length on purpose", 0); + charStringArgument = chip::Span("lowercasegarbage: not in length on purpose", 9); ReturnErrorOnFailure(cluster.WriteAttribute( charStringArgument, this, OnSuccessCallback_11, OnFailureCallback_11)); @@ -56203,6 +56414,194 @@ class TestConstraints : public TestCommand void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } void OnSuccessResponse_11() { NextTest(); } + + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_12() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_12, OnFailureCallback_12)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_12(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_12(chip::CharSpan charString) + { + VerifyOrReturn(CheckConstraintIsUpperCase("charString", charString, false)); + VerifyOrReturn(CheckConstraintIsLowerCase("charString", charString, true)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeCharStringValue_13() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::CharSpan charStringArgument; + charStringArgument = chip::Span("UPPERCASEgarbage: not in length on purpose", 9); + + ReturnErrorOnFailure(cluster.WriteAttribute( + charStringArgument, this, OnSuccessCallback_13, OnFailureCallback_13)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_13(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_13() { NextTest(); } + + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_14() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_14, OnFailureCallback_14)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_14(chip::CharSpan charString) + { + VerifyOrReturn(CheckConstraintIsUpperCase("charString", charString, true)); + VerifyOrReturn(CheckConstraintIsLowerCase("charString", charString, false)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeCharStringValue_15() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::CharSpan charStringArgument; + charStringArgument = chip::Span("lowUPPERgarbage: not in length on purpose", 8); + + ReturnErrorOnFailure(cluster.WriteAttribute( + charStringArgument, this, OnSuccessCallback_15, OnFailureCallback_15)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_15(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_15() { NextTest(); } + + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_16() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_16, OnFailureCallback_16)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_16(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_16(chip::CharSpan charString) + { + VerifyOrReturn(CheckConstraintIsUpperCase("charString", charString, false)); + VerifyOrReturn(CheckConstraintIsLowerCase("charString", charString, false)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeCharStringValue_17() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::CharSpan charStringArgument; + charStringArgument = chip::Span("ABCDEF012Vgarbage: not in length on purpose", 10); + + ReturnErrorOnFailure(cluster.WriteAttribute( + charStringArgument, this, OnSuccessCallback_17, OnFailureCallback_17)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_17(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_17() { NextTest(); } + + CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_18() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_18, OnFailureCallback_18)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_18(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_18(chip::CharSpan charString) + { + VerifyOrReturn(CheckConstraintIsHexString("charString", charString, false)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeCharStringValue_19() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::CharSpan charStringArgument; + charStringArgument = chip::Span("ABCDEF0123garbage: not in length on purpose", 10); + + ReturnErrorOnFailure(cluster.WriteAttribute( + charStringArgument, this, OnSuccessCallback_19, OnFailureCallback_19)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_19(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_19() { NextTest(); } + + CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_20() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_20, OnFailureCallback_20)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_20(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_20(chip::CharSpan charString) + { + VerifyOrReturn(CheckConstraintIsHexString("charString", charString, true)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeCharStringValueBackToDefaultValue_21() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::CharSpan charStringArgument; + charStringArgument = chip::Span("garbage: not in length on purpose", 0); + + ReturnErrorOnFailure(cluster.WriteAttribute( + charStringArgument, this, OnSuccessCallback_21, OnFailureCallback_21)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_21(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_21() { NextTest(); } }; class TestDelayCommands : public TestCommand