From 1174787c96a65fa4b61b7856b1e202372b964cef Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 15 May 2023 09:58:32 -0400 Subject: [PATCH] Fix isUpperCase/isLowerCase constraint checking in python yaml processing. (#26536) * Fix isUpperCase/isLowerCase constraint checking in python yaml processing. I just got a CI failure like so: TEST OUT: isUpperCase: true <-- The response "9659674627744477" contains lowercase characters: []. but of course it does not. It just happens to be an instance name that didn't end up using any hex chars that are > 9. This change better aligns the way Python tests uppercase/lowercase with the built-in chip-tool constraint impl. * Address review comments. * Fix restyle issue. --- .../matter_yamltests/constraints.py | 8 +- src/app/tests/suites/TestConstraints.yaml | 77 ++++ .../tests/suites/include/ConstraintsChecker.h | 2 +- .../chip-tool/zap-generated/test/Commands.h | 213 ++++++++-- .../zap-generated/test/Commands.h | 388 +++++++++++++++--- 5 files changed, 589 insertions(+), 99 deletions(-) diff --git a/scripts/py_matter_yamltests/matter_yamltests/constraints.py b/scripts/py_matter_yamltests/matter_yamltests/constraints.py index 1c615e784ef51d..65e11b15db9cb8 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/constraints.py +++ b/scripts/py_matter_yamltests/matter_yamltests/constraints.py @@ -582,7 +582,9 @@ def __init__(self, context, is_upper_case): self._is_upper_case = is_upper_case def check_response(self, value, value_type_name) -> bool: - return value.isupper() == self._is_upper_case + # Make sure we don't have any lowercase characters. + hasLower = any(c.islower() for c in value) + return hasLower != self._is_upper_case def get_reason(self, value, value_type_name) -> str: if self._is_upper_case: @@ -608,7 +610,9 @@ def __init__(self, context, is_lower_case): self._is_lower_case = is_lower_case def check_response(self, value, value_type_name) -> bool: - return value.islower() == self._is_lower_case + # Make sure we don't have any uppercase characters. + hasUpper = any(c.isupper() for c in value) + return hasUpper != self._is_lower_case def get_reason(self, value, value_type_name) -> str: if self._is_lower_case: diff --git a/src/app/tests/suites/TestConstraints.yaml b/src/app/tests/suites/TestConstraints.yaml index 4ef38820de4464..60b88ead227c65 100644 --- a/src/app/tests/suites/TestConstraints.yaml +++ b/src/app/tests/suites/TestConstraints.yaml @@ -234,6 +234,83 @@ tests: isUpperCase: false isLowerCase: false + - label: "Write attribute CHAR_STRING Value with only digits" + command: "writeAttribute" + attribute: "char_string" + arguments: + value: "1234567890" + + - label: + "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints" + command: "readAttribute" + attribute: "char_string" + response: + constraints: + isUpperCase: true + isLowerCase: true + + - label: "Write attribute CHAR_STRING Value with only non-letters" + command: "writeAttribute" + attribute: "char_string" + arguments: + value: "12.4,76:" + + - label: + "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints" + command: "readAttribute" + attribute: "char_string" + response: + constraints: + isUpperCase: true + isLowerCase: true + + - label: + "Write attribute CHAR_STRING Value with uppercase letters and symbols" + command: "writeAttribute" + attribute: "char_string" + arguments: + value: "ABC;.* " + + - 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 with lowercase letters and symbols" + command: "writeAttribute" + attribute: "char_string" + arguments: + value: "abc;.* " + + - label: + "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints" + command: "readAttribute" + attribute: "char_string" + response: + constraints: + isUpperCase: false + isLowerCase: true + + - label: "Write attribute CHAR_STRING Value which is empty" + command: "writeAttribute" + attribute: "char_string" + arguments: + value: "" + + - label: + "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints" + command: "readAttribute" + attribute: "char_string" + response: + constraints: + isUpperCase: true + isLowerCase: true + - label: "Write attribute CHAR_STRING 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 84f2dc8dff6321..be446fd3f42c28 100644 --- a/src/app/tests/suites/include/ConstraintsChecker.h +++ b/src/app/tests/suites/include/ConstraintsChecker.h @@ -146,7 +146,7 @@ class ConstraintsChecker bool isUpperCase = true; for (size_t i = 0; i < strlen(current); i++) { - if (!isdigit(current[i]) && !isupper(current[i])) + if (islower(current[i])) { isUpperCase = false; break; diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 26be2fb5b4c935..5fd032665223ff 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -65351,7 +65351,7 @@ class TestClusterComplexTypesSuite : public TestCommand class TestConstraintsSuite : public TestCommand { public: - TestConstraintsSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestConstraints", 45, credsIssuerConfig) + TestConstraintsSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestConstraints", 55, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -65573,7 +65573,8 @@ class TestConstraintsSuite : public TestCommand { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintIsHexString("value", value, false)); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, true)); + VerifyOrReturn(CheckConstraintIsLowerCase("value", value, true)); } break; case 30: @@ -65584,7 +65585,8 @@ class TestConstraintsSuite : public TestCommand { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintIsHexString("value", value, true)); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, true)); + VerifyOrReturn(CheckConstraintIsLowerCase("value", value, true)); } break; case 32: @@ -65593,10 +65595,10 @@ class TestConstraintsSuite : public TestCommand case 33: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable value; + chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValueNonNull("nullableInt8u", value)); - VerifyOrReturn(CheckValue("nullableInt8u.Value()", value.Value(), 0U)); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, true)); + VerifyOrReturn(CheckConstraintIsLowerCase("value", value, false)); } break; case 34: @@ -65605,8 +65607,10 @@ class TestConstraintsSuite : public TestCommand case 35: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable value; + chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, false)); + VerifyOrReturn(CheckConstraintIsLowerCase("value", value, true)); } break; case 36: @@ -65615,14 +65619,70 @@ class TestConstraintsSuite : public TestCommand case 37: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable value; + chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, true)); + VerifyOrReturn(CheckConstraintIsLowerCase("value", value, true)); } break; case 38: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintIsHexString("value", value, false)); + } + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintIsHexString("value", value, true)); + } + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt8u", value)); + VerifyOrReturn(CheckValue("nullableInt8u.Value()", value.Value(), 0U)); + } + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 49: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -65632,27 +65692,27 @@ class TestConstraintsSuite : public TestCommand chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); } break; - case 40: + case 50: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 41: + case 51: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); } break; - case 42: + case 52: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 43: + case 53: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); } break; - case 44: + case 54: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; default: @@ -65853,46 +65913,111 @@ class TestConstraintsSuite : public TestCommand chip::NullOptional); } case 28: { - LogStep(28, "Write attribute CHAR_STRING Value"); + LogStep(28, "Write attribute CHAR_STRING Value with only digits"); ListFreer listFreer; chip::CharSpan value; - value = chip::Span("ABCDEF012Vgarbage: not in length on purpose", 10); + value = chip::Span("1234567890garbage: not in length on purpose", 10); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, chip::NullOptional, chip::NullOptional); } case 29: { - LogStep(29, "Read attribute CHAR_STRING Value isHexString Constraints"); + LogStep(29, "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, chip::NullOptional); } case 30: { - LogStep(30, "Write attribute CHAR_STRING Value"); + LogStep(30, "Write attribute CHAR_STRING Value with only non-letters"); ListFreer listFreer; chip::CharSpan value; - value = chip::Span("ABCDEF0123garbage: not in length on purpose", 10); + value = chip::Span("12.4,76:garbage: not in length on purpose", 8); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, chip::NullOptional, chip::NullOptional); } case 31: { - LogStep(31, "Read attribute CHAR_STRING Value isHexString Constraints"); + LogStep(31, "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, chip::NullOptional); } case 32: { - LogStep(32, "Write attribute CHAR_STRING Value Back to Default Value"); + LogStep(32, "Write attribute CHAR_STRING Value with uppercase letters and symbols"); ListFreer listFreer; chip::CharSpan value; - value = chip::Span("garbage: not in length on purpose", 0); + value = chip::Span("ABC;.* garbage: not in length on purpose", 7); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, chip::NullOptional, chip::NullOptional); } case 33: { - LogStep(33, "Read attribute NULLABLE_INT8U Default Value"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, + LogStep(33, "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, chip::NullOptional); } case 34: { - LogStep(34, "Write attribute NULLABLE_INT8U with a value"); + LogStep(34, "Write attribute CHAR_STRING Value with lowercase letters and symbols"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("abc;.* garbage: not in length on purpose", 7); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 35: { + LogStep(35, "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 36: { + LogStep(36, "Write attribute CHAR_STRING Value which is empty"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("garbage: not in length on purpose", 0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 37: { + LogStep(37, "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 38: { + LogStep(38, "Write attribute CHAR_STRING Value"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("ABCDEF012Vgarbage: not in length on purpose", 10); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 39: { + LogStep(39, "Read attribute CHAR_STRING Value isHexString Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 40: { + LogStep(40, "Write attribute CHAR_STRING Value"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("ABCDEF0123garbage: not in length on purpose", 10); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 41: { + LogStep(41, "Read attribute CHAR_STRING Value isHexString Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); + } + case 42: { + LogStep(42, "Write attribute CHAR_STRING Value Back to Default Value"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("garbage: not in length on purpose", 0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 43: { + LogStep(43, "Read attribute NULLABLE_INT8U Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, + chip::NullOptional); + } + case 44: { + LogStep(44, "Write attribute NULLABLE_INT8U with a value"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); @@ -65900,26 +66025,26 @@ class TestConstraintsSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, value, chip::NullOptional, chip::NullOptional); } - case 35: { - LogStep(35, "Read attribute NULLABLE_INT8U with a value"); + case 45: { + LogStep(45, "Read attribute NULLABLE_INT8U with a value"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, chip::NullOptional); } - case 36: { - LogStep(36, "Write attribute NULLABLE_INT8U without a value"); + case 46: { + LogStep(46, "Write attribute NULLABLE_INT8U without a value"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNull(); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, value, chip::NullOptional, chip::NullOptional); } - case 37: { - LogStep(37, "Read attribute NULLABLE_INT8U with a value"); + case 47: { + LogStep(47, "Read attribute NULLABLE_INT8U with a value"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, chip::NullOptional); } - case 38: { - LogStep(38, "Write attribute NULLABLE_INT8U back to Default Value"); + case 48: { + LogStep(48, "Write attribute NULLABLE_INT8U back to Default Value"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); @@ -65927,13 +66052,13 @@ class TestConstraintsSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, value, chip::NullOptional, chip::NullOptional); } - case 39: { - LogStep(39, "Read attribute NULLABLE_OCTET_STRING Default Value"); + case 49: { + LogStep(49, "Read attribute NULLABLE_OCTET_STRING Default Value"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, true, chip::NullOptional); } - case 40: { - LogStep(40, "Write attribute NULLABLE_OCTET_STRING"); + case 50: { + LogStep(50, "Write attribute NULLABLE_OCTET_STRING"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); @@ -65941,26 +66066,26 @@ class TestConstraintsSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, value, chip::NullOptional, chip::NullOptional); } - case 41: { - LogStep(41, "Read attribute NULLABLE_OCTET_STRING"); + case 51: { + LogStep(51, "Read attribute NULLABLE_OCTET_STRING"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, true, chip::NullOptional); } - case 42: { - LogStep(42, "Write attribute NULLABLE_OCTET_STRING"); + case 52: { + LogStep(52, "Write attribute NULLABLE_OCTET_STRING"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNull(); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, value, chip::NullOptional, chip::NullOptional); } - case 43: { - LogStep(43, "Read attribute NULLABLE_OCTET_STRING"); + case 53: { + LogStep(53, "Read attribute NULLABLE_OCTET_STRING"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, true, chip::NullOptional); } - case 44: { - LogStep(44, "Write attribute NULLABLE_OCTET_STRING back to Default Value"); + case 54: { + LogStep(54, "Write attribute NULLABLE_OCTET_STRING back to Default Value"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index a0495741bf95b9..9ef1f81f31958c 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -95789,72 +95789,119 @@ class TestConstraints : public TestCommandBridge { err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_27(); break; case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Write attribute CHAR_STRING Value\n"); - err = TestWriteAttributeCharStringValue_28(); + ChipLogProgress(chipTool, " ***** Test Step 28 : Write attribute CHAR_STRING Value with only digits\n"); + err = TestWriteAttributeCharStringValueWithOnlyDigits_28(); break; case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Read attribute CHAR_STRING Value isHexString Constraints\n"); - err = TestReadAttributeCharStringValueIsHexStringConstraints_29(); + ChipLogProgress( + chipTool, " ***** Test Step 29 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); + err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_29(); break; case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Write attribute CHAR_STRING Value\n"); - err = TestWriteAttributeCharStringValue_30(); + ChipLogProgress(chipTool, " ***** Test Step 30 : Write attribute CHAR_STRING Value with only non-letters\n"); + err = TestWriteAttributeCharStringValueWithOnlyNonLetters_30(); break; case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : Read attribute CHAR_STRING Value isHexString Constraints\n"); - err = TestReadAttributeCharStringValueIsHexStringConstraints_31(); + ChipLogProgress( + chipTool, " ***** Test Step 31 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); + err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_31(); break; case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : Write attribute CHAR_STRING Value Back to Default Value\n"); - err = TestWriteAttributeCharStringValueBackToDefaultValue_32(); + ChipLogProgress( + chipTool, " ***** Test Step 32 : Write attribute CHAR_STRING Value with uppercase letters and symbols\n"); + err = TestWriteAttributeCharStringValueWithUppercaseLettersAndSymbols_32(); break; case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Read attribute NULLABLE_INT8U Default Value\n"); - err = TestReadAttributeNullableInt8uDefaultValue_33(); + ChipLogProgress( + chipTool, " ***** Test Step 33 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); + err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_33(); break; case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : Write attribute NULLABLE_INT8U with a value\n"); - err = TestWriteAttributeNullableInt8uWithAValue_34(); + ChipLogProgress( + chipTool, " ***** Test Step 34 : Write attribute CHAR_STRING Value with lowercase letters and symbols\n"); + err = TestWriteAttributeCharStringValueWithLowercaseLettersAndSymbols_34(); break; case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : Read attribute NULLABLE_INT8U with a value\n"); - err = TestReadAttributeNullableInt8uWithAValue_35(); + ChipLogProgress( + chipTool, " ***** Test Step 35 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); + err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_35(); break; case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : Write attribute NULLABLE_INT8U without a value\n"); - err = TestWriteAttributeNullableInt8uWithoutAValue_36(); + ChipLogProgress(chipTool, " ***** Test Step 36 : Write attribute CHAR_STRING Value which is empty\n"); + err = TestWriteAttributeCharStringValueWhichIsEmpty_36(); break; case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : Read attribute NULLABLE_INT8U with a value\n"); - err = TestReadAttributeNullableInt8uWithAValue_37(); + ChipLogProgress( + chipTool, " ***** Test Step 37 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); + err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_37(); break; case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : Write attribute NULLABLE_INT8U back to Default Value\n"); - err = TestWriteAttributeNullableInt8uBackToDefaultValue_38(); + ChipLogProgress(chipTool, " ***** Test Step 38 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_38(); break; case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : Read attribute NULLABLE_OCTET_STRING Default Value\n"); - err = TestReadAttributeNullableOctetStringDefaultValue_39(); + ChipLogProgress(chipTool, " ***** Test Step 39 : Read attribute CHAR_STRING Value isHexString Constraints\n"); + err = TestReadAttributeCharStringValueIsHexStringConstraints_39(); break; case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : Write attribute NULLABLE_OCTET_STRING\n"); - err = TestWriteAttributeNullableOctetString_40(); + ChipLogProgress(chipTool, " ***** Test Step 40 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_40(); break; case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Read attribute NULLABLE_OCTET_STRING\n"); - err = TestReadAttributeNullableOctetString_41(); + ChipLogProgress(chipTool, " ***** Test Step 41 : Read attribute CHAR_STRING Value isHexString Constraints\n"); + err = TestReadAttributeCharStringValueIsHexStringConstraints_41(); break; case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : Write attribute NULLABLE_OCTET_STRING\n"); - err = TestWriteAttributeNullableOctetString_42(); + ChipLogProgress(chipTool, " ***** Test Step 42 : Write attribute CHAR_STRING Value Back to Default Value\n"); + err = TestWriteAttributeCharStringValueBackToDefaultValue_42(); break; case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Read attribute NULLABLE_OCTET_STRING\n"); - err = TestReadAttributeNullableOctetString_43(); + ChipLogProgress(chipTool, " ***** Test Step 43 : Read attribute NULLABLE_INT8U Default Value\n"); + err = TestReadAttributeNullableInt8uDefaultValue_43(); break; case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : Write attribute NULLABLE_OCTET_STRING back to Default Value\n"); - err = TestWriteAttributeNullableOctetStringBackToDefaultValue_44(); + ChipLogProgress(chipTool, " ***** Test Step 44 : Write attribute NULLABLE_INT8U with a value\n"); + err = TestWriteAttributeNullableInt8uWithAValue_44(); + break; + case 45: + ChipLogProgress(chipTool, " ***** Test Step 45 : Read attribute NULLABLE_INT8U with a value\n"); + err = TestReadAttributeNullableInt8uWithAValue_45(); + break; + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : Write attribute NULLABLE_INT8U without a value\n"); + err = TestWriteAttributeNullableInt8uWithoutAValue_46(); + break; + case 47: + ChipLogProgress(chipTool, " ***** Test Step 47 : Read attribute NULLABLE_INT8U with a value\n"); + err = TestReadAttributeNullableInt8uWithAValue_47(); + break; + case 48: + ChipLogProgress(chipTool, " ***** Test Step 48 : Write attribute NULLABLE_INT8U back to Default Value\n"); + err = TestWriteAttributeNullableInt8uBackToDefaultValue_48(); + break; + case 49: + ChipLogProgress(chipTool, " ***** Test Step 49 : Read attribute NULLABLE_OCTET_STRING Default Value\n"); + err = TestReadAttributeNullableOctetStringDefaultValue_49(); + break; + case 50: + ChipLogProgress(chipTool, " ***** Test Step 50 : Write attribute NULLABLE_OCTET_STRING\n"); + err = TestWriteAttributeNullableOctetString_50(); + break; + case 51: + ChipLogProgress(chipTool, " ***** Test Step 51 : Read attribute NULLABLE_OCTET_STRING\n"); + err = TestReadAttributeNullableOctetString_51(); + break; + case 52: + ChipLogProgress(chipTool, " ***** Test Step 52 : Write attribute NULLABLE_OCTET_STRING\n"); + err = TestWriteAttributeNullableOctetString_52(); + break; + case 53: + ChipLogProgress(chipTool, " ***** Test Step 53 : Read attribute NULLABLE_OCTET_STRING\n"); + err = TestReadAttributeNullableOctetString_53(); + break; + case 54: + ChipLogProgress(chipTool, " ***** Test Step 54 : Write attribute NULLABLE_OCTET_STRING back to Default Value\n"); + err = TestWriteAttributeNullableOctetStringBackToDefaultValue_54(); break; } @@ -96002,6 +96049,36 @@ class TestConstraints : public TestCommandBridge { case 44: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -96015,7 +96092,7 @@ class TestConstraints : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 45; + const uint16_t mTestCount = 55; chip::Optional mNodeId; chip::Optional mCluster; @@ -96604,7 +96681,214 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_28() + CHIP_ERROR TestWriteAttributeCharStringValueWithOnlyDigits_28() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id charStringArgument; + charStringArgument = @"1234567890"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value with only digits Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_29() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCharStringWithCompletion:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintIsUpperCase("charString", value, true)); + VerifyOrReturn(CheckConstraintIsLowerCase("charString", value, true)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeCharStringValueWithOnlyNonLetters_30() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id charStringArgument; + charStringArgument = @"12.4,76:"; + [cluster writeAttributeCharStringWithValue:charStringArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value with only non-letters Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_31() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCharStringWithCompletion:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintIsUpperCase("charString", value, true)); + VerifyOrReturn(CheckConstraintIsLowerCase("charString", value, true)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeCharStringValueWithUppercaseLettersAndSymbols_32() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id charStringArgument; + charStringArgument = @"ABC;.* "; + [cluster writeAttributeCharStringWithValue:charStringArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value with uppercase letters and symbols Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_33() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCharStringWithCompletion:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintIsUpperCase("charString", value, true)); + VerifyOrReturn(CheckConstraintIsLowerCase("charString", value, false)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeCharStringValueWithLowercaseLettersAndSymbols_34() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id charStringArgument; + charStringArgument = @"abc;.* "; + [cluster writeAttributeCharStringWithValue:charStringArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value with lowercase letters and symbols Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_35() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCharStringWithCompletion:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintIsUpperCase("charString", value, false)); + VerifyOrReturn(CheckConstraintIsLowerCase("charString", value, true)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeCharStringValueWhichIsEmpty_36() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id charStringArgument; + charStringArgument = @""; + [cluster writeAttributeCharStringWithValue:charStringArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Write attribute CHAR_STRING Value which is empty Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_37() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCharStringWithCompletion:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintIsUpperCase("charString", value, true)); + VerifyOrReturn(CheckConstraintIsLowerCase("charString", value, true)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeCharStringValue_38() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96625,7 +96909,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_29() + CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_39() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96644,7 +96928,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_30() + CHIP_ERROR TestWriteAttributeCharStringValue_40() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96665,7 +96949,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_31() + CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_41() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96684,7 +96968,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValueBackToDefaultValue_32() + CHIP_ERROR TestWriteAttributeCharStringValueBackToDefaultValue_42() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96705,7 +96989,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uDefaultValue_33() + CHIP_ERROR TestReadAttributeNullableInt8uDefaultValue_43() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96729,7 +97013,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8uWithAValue_34() + CHIP_ERROR TestWriteAttributeNullableInt8uWithAValue_44() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96750,7 +97034,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uWithAValue_35() + CHIP_ERROR TestReadAttributeNullableInt8uWithAValue_45() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96771,7 +97055,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8uWithoutAValue_36() + CHIP_ERROR TestWriteAttributeNullableInt8uWithoutAValue_46() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96792,7 +97076,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uWithAValue_37() + CHIP_ERROR TestReadAttributeNullableInt8uWithAValue_47() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96813,7 +97097,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8uBackToDefaultValue_38() + CHIP_ERROR TestWriteAttributeNullableInt8uBackToDefaultValue_48() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96834,7 +97118,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableOctetStringDefaultValue_39() + CHIP_ERROR TestReadAttributeNullableOctetStringDefaultValue_49() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96859,7 +97143,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableOctetString_40() + CHIP_ERROR TestWriteAttributeNullableOctetString_50() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96880,7 +97164,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableOctetString_41() + CHIP_ERROR TestReadAttributeNullableOctetString_51() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96901,7 +97185,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableOctetString_42() + CHIP_ERROR TestWriteAttributeNullableOctetString_52() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96922,7 +97206,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableOctetString_43() + CHIP_ERROR TestReadAttributeNullableOctetString_53() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96943,7 +97227,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableOctetStringBackToDefaultValue_44() + CHIP_ERROR TestWriteAttributeNullableOctetStringBackToDefaultValue_54() { MTRBaseDevice * device = GetDevice("alpha");