From 10c261c77c9501ab69ff335f5c3beb817b754725 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Wed, 14 Jun 2023 18:58:31 +0200 Subject: [PATCH] [matter_yamltests] Reproduce the c++ behavior for hasMasksSet --- .../matter_yamltests/constraints.py | 2 +- src/app/tests/suites/TestConstraints.yaml | 16 + .../chip-tool/zap-generated/test/Commands.h | 249 +++++++++------- .../zap-generated/test/Commands.h | 273 +++++++++++------- 4 files changed, 320 insertions(+), 220 deletions(-) diff --git a/scripts/py_matter_yamltests/matter_yamltests/constraints.py b/scripts/py_matter_yamltests/matter_yamltests/constraints.py index 93558330e18ed6..4e985987ae6ca6 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/constraints.py +++ b/scripts/py_matter_yamltests/matter_yamltests/constraints.py @@ -728,7 +728,7 @@ def __init__(self, context, has_masks_set): self._has_masks_set = has_masks_set def check_response(self, value, value_type_name) -> bool: - return all([(value & mask) == mask for mask in self._has_masks_set]) + return all([(value & mask) for mask in self._has_masks_set]) def get_reason(self, value, value_type_name) -> str: expected_masks = [] diff --git a/src/app/tests/suites/TestConstraints.yaml b/src/app/tests/suites/TestConstraints.yaml index 60b88ead227c65..aa1896d7ebd94e 100644 --- a/src/app/tests/suites/TestConstraints.yaml +++ b/src/app/tests/suites/TestConstraints.yaml @@ -112,6 +112,22 @@ tests: constraints: hasMasksSet: [0x01, 0x04] # [MaskVal1, MaskVal3] + - label: "Write attribute BITMAP32 with MaskVal1" + command: "writeAttribute" + attribute: "bitmap32" + arguments: + value: 1 # MaskVal1 + + - label: + "Read attribute BITMAP32 with MaskVal1 and ensure Maskval1 or MaskVal3 + are set" + command: "readAttribute" + attribute: "bitmap32" + response: + value: 1 # MaskVal1 + constraints: + hasMasksSet: [0x05] # [MaskVal1, MaskVal3] + - label: "Write attribute BITMAP32 Back to Default Value" command: "writeAttribute" attribute: "bitmap32" diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index ac13daf482c5f8..bd8f0f92d82a80 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -72397,7 +72397,7 @@ class TestClusterComplexTypesSuite : public TestCommand class TestConstraintsSuite : public TestCommand { public: - TestConstraintsSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestConstraints", 55, credsIssuerConfig) + TestConstraintsSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestConstraints", 57, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -72512,8 +72512,20 @@ class TestConstraintsSuite : public TestCommand break; case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap32", value, 1UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 5UL)); + } break; case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint32_t value; @@ -72521,7 +72533,7 @@ class TestConstraintsSuite : public TestCommand VerifyOrReturn(CheckConstraintMinValue("value", value, 5UL)); } break; - case 14: + case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint32_t value; @@ -72529,7 +72541,7 @@ class TestConstraintsSuite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 5UL)); } break; - case 15: + case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint32_t value; @@ -72537,13 +72549,13 @@ class TestConstraintsSuite : public TestCommand VerifyOrReturn(CheckConstraintNotValue("value", value, 6UL)); } break; - case 16: + case 18: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 17: + case 19: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 18: + case 20: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::CharSpan value; @@ -72551,7 +72563,7 @@ class TestConstraintsSuite : public TestCommand VerifyOrReturn(CheckConstraintMinLength("value", value, 5)); } break; - case 19: + case 21: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::CharSpan value; @@ -72559,7 +72571,7 @@ class TestConstraintsSuite : public TestCommand VerifyOrReturn(CheckConstraintMaxLength("value", value, 20)); } break; - case 20: + case 22: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::CharSpan value; @@ -72567,24 +72579,12 @@ class TestConstraintsSuite : public TestCommand VerifyOrReturn(CheckConstraintStartsWith("value", value, "**")); } break; - case 21: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::CharSpan value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintEndsWith("value", value, "**")); - } - break; - case 22: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; case 23: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintIsLowerCase("value", value, true)); - VerifyOrReturn(CheckConstraintIsUpperCase("value", value, false)); + VerifyOrReturn(CheckConstraintEndsWith("value", value, "**")); } break; case 24: @@ -72595,8 +72595,8 @@ class TestConstraintsSuite : public TestCommand { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintIsUpperCase("value", value, true)); - VerifyOrReturn(CheckConstraintIsLowerCase("value", value, false)); + VerifyOrReturn(CheckConstraintIsLowerCase("value", value, true)); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, false)); } break; case 26: @@ -72607,7 +72607,7 @@ class TestConstraintsSuite : public TestCommand { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintIsUpperCase("value", value, false)); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, true)); VerifyOrReturn(CheckConstraintIsLowerCase("value", value, false)); } break; @@ -72619,8 +72619,8 @@ class TestConstraintsSuite : public TestCommand { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintIsUpperCase("value", value, true)); - VerifyOrReturn(CheckConstraintIsLowerCase("value", value, true)); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, false)); + VerifyOrReturn(CheckConstraintIsLowerCase("value", value, false)); } break; case 30: @@ -72644,7 +72644,7 @@ class TestConstraintsSuite : public TestCommand chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintIsUpperCase("value", value, true)); - VerifyOrReturn(CheckConstraintIsLowerCase("value", value, false)); + VerifyOrReturn(CheckConstraintIsLowerCase("value", value, true)); } break; case 34: @@ -72655,8 +72655,8 @@ class TestConstraintsSuite : public TestCommand { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintIsUpperCase("value", value, false)); - VerifyOrReturn(CheckConstraintIsLowerCase("value", value, true)); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, true)); + VerifyOrReturn(CheckConstraintIsLowerCase("value", value, false)); } break; case 36: @@ -72667,7 +72667,7 @@ class TestConstraintsSuite : public TestCommand { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintIsUpperCase("value", value, true)); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, false)); VerifyOrReturn(CheckConstraintIsLowerCase("value", value, true)); } break; @@ -72679,7 +72679,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 40: @@ -72690,7 +72691,7 @@ class TestConstraintsSuite : public TestCommand { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintIsHexString("value", value, true)); + VerifyOrReturn(CheckConstraintIsHexString("value", value, false)); } break; case 42: @@ -72699,10 +72700,9 @@ class TestConstraintsSuite : public TestCommand case 43: 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(CheckConstraintIsHexString("value", value, true)); } break; case 44: @@ -72713,6 +72713,8 @@ class TestConstraintsSuite : public TestCommand { 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 46: @@ -72731,11 +72733,8 @@ class TestConstraintsSuite : public TestCommand case 49: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable value; + chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValueNonNull("nullableOctetString", value)); - VerifyOrReturn(CheckValueAsString("nullableOctetString.Value()", value.Value(), - chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); } break; case 50: @@ -72746,6 +72745,9 @@ class TestConstraintsSuite : public TestCommand { chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableOctetString", value)); + VerifyOrReturn(CheckValueAsString("nullableOctetString.Value()", value.Value(), + chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); } break; case 52: @@ -72761,6 +72763,16 @@ class TestConstraintsSuite : public TestCommand case 54: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -72853,82 +72865,82 @@ class TestConstraintsSuite : public TestCommand chip::NullOptional); } case 11: { - LogStep(11, "Write attribute BITMAP32 Back to Default Value"); + LogStep(11, "Write attribute BITMAP32 with MaskVal1"); ListFreer listFreer; chip::BitMask value; - value = static_cast>(0UL); + value = static_cast>(1UL); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, value, chip::NullOptional, chip::NullOptional); } case 12: { - LogStep(12, "Write attribute INT32U Value"); + LogStep(12, "Read attribute BITMAP32 with MaskVal1 and ensure Maskval1 or MaskVal3 are set"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Write attribute BITMAP32 Back to Default Value"); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(0UL); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 14: { + LogStep(14, "Write attribute INT32U Value"); ListFreer listFreer; uint32_t value; value = 5UL; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, value, chip::NullOptional, chip::NullOptional); } - case 13: { - LogStep(13, "Read attribute INT32U Value MinValue Constraints"); + case 15: { + LogStep(15, "Read attribute INT32U Value MinValue Constraints"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, true, chip::NullOptional); } - case 14: { - LogStep(14, "Read attribute INT32U Value MaxValue Constraints"); + case 16: { + LogStep(16, "Read attribute INT32U Value MaxValue Constraints"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, true, chip::NullOptional); } - case 15: { - LogStep(15, "Read attribute INT32U Value NotValue Constraints"); + case 17: { + LogStep(17, "Read attribute INT32U Value NotValue Constraints"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, true, chip::NullOptional); } - case 16: { - LogStep(16, "Write attribute INT32U Value Back to Default Value"); + case 18: { + LogStep(18, "Write attribute INT32U Value Back to Default Value"); ListFreer listFreer; uint32_t value; value = 0UL; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, value, chip::NullOptional, chip::NullOptional); } - case 17: { - LogStep(17, "Write attribute CHAR_STRING Value"); + case 19: { + LogStep(19, "Write attribute CHAR_STRING Value"); ListFreer listFreer; chip::CharSpan value; value = chip::Span("** Test **garbage: not in length on purpose", 10); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, chip::NullOptional, chip::NullOptional); } - case 18: { - LogStep(18, "Read attribute CHAR_STRING Value MinLength Constraints"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, - chip::NullOptional); - } - case 19: { - LogStep(19, "Read attribute CHAR_STRING Value MaxLength Constraints"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, - chip::NullOptional); - } case 20: { - LogStep(20, "Read attribute CHAR_STRING Value StartsWith Constraints"); + LogStep(20, "Read attribute CHAR_STRING Value MinLength Constraints"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, chip::NullOptional); } case 21: { - LogStep(21, "Read attribute CHAR_STRING Value EndsWith Constraints"); + LogStep(21, "Read attribute CHAR_STRING Value MaxLength Constraints"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, chip::NullOptional); } case 22: { - LogStep(22, "Write attribute CHAR_STRING Value"); - ListFreer listFreer; - chip::CharSpan value; - value = chip::Span("lowercasegarbage: not in length on purpose", 9); - return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, - chip::NullOptional, chip::NullOptional); + LogStep(22, "Read attribute CHAR_STRING Value StartsWith Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); } case 23: { - LogStep(23, "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"); + LogStep(23, "Read attribute CHAR_STRING Value EndsWith Constraints"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, chip::NullOptional); } @@ -72936,7 +72948,7 @@ class TestConstraintsSuite : public TestCommand LogStep(24, "Write attribute CHAR_STRING Value"); ListFreer listFreer; chip::CharSpan value; - value = chip::Span("UPPERCASEgarbage: not in length on purpose", 9); + value = chip::Span("lowercasegarbage: not in length on purpose", 9); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, chip::NullOptional, chip::NullOptional); } @@ -72949,7 +72961,7 @@ class TestConstraintsSuite : public TestCommand LogStep(26, "Write attribute CHAR_STRING Value"); ListFreer listFreer; chip::CharSpan value; - value = chip::Span("lowUPPERgarbage: not in length on purpose", 8); + value = chip::Span("UPPERCASEgarbage: not in length on purpose", 9); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, chip::NullOptional, chip::NullOptional); } @@ -72959,10 +72971,10 @@ class TestConstraintsSuite : public TestCommand chip::NullOptional); } case 28: { - LogStep(28, "Write attribute CHAR_STRING Value with only digits"); + LogStep(28, "Write attribute CHAR_STRING Value"); ListFreer listFreer; chip::CharSpan value; - value = chip::Span("1234567890garbage: not in length on purpose", 10); + value = chip::Span("lowUPPERgarbage: not in length on purpose", 8); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, chip::NullOptional, chip::NullOptional); } @@ -72972,10 +72984,10 @@ class TestConstraintsSuite : public TestCommand chip::NullOptional); } case 30: { - LogStep(30, "Write attribute CHAR_STRING Value with only non-letters"); + LogStep(30, "Write attribute CHAR_STRING Value with only digits"); ListFreer listFreer; chip::CharSpan value; - value = chip::Span("12.4,76:garbage: not in length on purpose", 8); + 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); } @@ -72985,10 +72997,10 @@ class TestConstraintsSuite : public TestCommand chip::NullOptional); } case 32: { - LogStep(32, "Write attribute CHAR_STRING Value with uppercase letters and symbols"); + LogStep(32, "Write attribute CHAR_STRING Value with only non-letters"); ListFreer listFreer; chip::CharSpan value; - value = chip::Span("ABC;.* garbage: not in length on purpose", 7); + 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); } @@ -72998,10 +73010,10 @@ class TestConstraintsSuite : public TestCommand chip::NullOptional); } case 34: { - LogStep(34, "Write attribute CHAR_STRING Value with lowercase letters and symbols"); + LogStep(34, "Write attribute CHAR_STRING Value with uppercase letters and symbols"); ListFreer listFreer; chip::CharSpan value; - value = chip::Span("abc;.* garbage: not in length on purpose", 7); + 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); } @@ -73011,10 +73023,10 @@ class TestConstraintsSuite : public TestCommand chip::NullOptional); } case 36: { - LogStep(36, "Write attribute CHAR_STRING Value which is empty"); + LogStep(36, "Write attribute CHAR_STRING Value with lowercase 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); } @@ -73024,15 +73036,15 @@ class TestConstraintsSuite : public TestCommand chip::NullOptional); } case 38: { - LogStep(38, "Write attribute CHAR_STRING Value"); + LogStep(38, "Write attribute CHAR_STRING Value which is empty"); ListFreer listFreer; chip::CharSpan value; - value = chip::Span("ABCDEF012Vgarbage: not in length on purpose", 10); + 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 39: { - LogStep(39, "Read attribute CHAR_STRING Value isHexString Constraints"); + LogStep(39, "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, chip::NullOptional); } @@ -73040,7 +73052,7 @@ class TestConstraintsSuite : public TestCommand LogStep(40, "Write attribute CHAR_STRING Value"); ListFreer listFreer; chip::CharSpan value; - value = chip::Span("ABCDEF0123garbage: not in length on purpose", 10); + 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); } @@ -73050,20 +73062,33 @@ class TestConstraintsSuite : public TestCommand chip::NullOptional); } case 42: { - LogStep(42, "Write attribute CHAR_STRING Value Back to Default Value"); + LogStep(42, "Write attribute CHAR_STRING Value"); ListFreer listFreer; chip::CharSpan value; - value = chip::Span("garbage: not in length on purpose", 0); + 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 43: { - LogStep(43, "Read attribute NULLABLE_INT8U Default Value"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, + LogStep(43, "Read attribute CHAR_STRING Value isHexString Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, chip::NullOptional); } case 44: { - LogStep(44, "Write attribute NULLABLE_INT8U with a value"); + LogStep(44, "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 45: { + LogStep(45, "Read attribute NULLABLE_INT8U Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, + chip::NullOptional); + } + case 46: { + LogStep(46, "Write attribute NULLABLE_INT8U with a value"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); @@ -73071,26 +73096,26 @@ class TestConstraintsSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, value, chip::NullOptional, chip::NullOptional); } - case 45: { - LogStep(45, "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 46: { - LogStep(46, "Write attribute NULLABLE_INT8U without a value"); + case 48: { + LogStep(48, "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 47: { - LogStep(47, "Read attribute NULLABLE_INT8U with a value"); + case 49: { + LogStep(49, "Read attribute NULLABLE_INT8U with a value"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, chip::NullOptional); } - case 48: { - LogStep(48, "Write attribute NULLABLE_INT8U back to Default Value"); + case 50: { + LogStep(50, "Write attribute NULLABLE_INT8U back to Default Value"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); @@ -73098,13 +73123,13 @@ class TestConstraintsSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, value, chip::NullOptional, chip::NullOptional); } - case 49: { - LogStep(49, "Read attribute NULLABLE_OCTET_STRING Default Value"); + case 51: { + LogStep(51, "Read attribute NULLABLE_OCTET_STRING Default Value"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, true, chip::NullOptional); } - case 50: { - LogStep(50, "Write attribute NULLABLE_OCTET_STRING"); + case 52: { + LogStep(52, "Write attribute NULLABLE_OCTET_STRING"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); @@ -73112,26 +73137,26 @@ class TestConstraintsSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, value, chip::NullOptional, chip::NullOptional); } - case 51: { - LogStep(51, "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 52: { - LogStep(52, "Write attribute NULLABLE_OCTET_STRING"); + case 54: { + LogStep(54, "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 53: { - LogStep(53, "Read attribute NULLABLE_OCTET_STRING"); + case 55: { + LogStep(55, "Read attribute NULLABLE_OCTET_STRING"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, true, chip::NullOptional); } - case 54: { - LogStep(54, "Write attribute NULLABLE_OCTET_STRING back to Default Value"); + case 56: { + LogStep(56, "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 025c152bed88cc..019717e676f697 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -104166,57 +104166,57 @@ class TestConstraints : public TestCommandBridge { err = TestReadAttributeBitmap32WithMaskVal1AndMaskVal3AndEnsureMaskval1AndMaskVal3AreSet_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Write attribute BITMAP32 Back to Default Value\n"); - err = TestWriteAttributeBitmap32BackToDefaultValue_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Write attribute BITMAP32 with MaskVal1\n"); + err = TestWriteAttributeBitmap32WithMaskVal1_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Write attribute INT32U Value\n"); - err = TestWriteAttributeInt32uValue_12(); + ChipLogProgress( + chipTool, " ***** Test Step 12 : Read attribute BITMAP32 with MaskVal1 and ensure Maskval1 or MaskVal3 are set\n"); + err = TestReadAttributeBitmap32WithMaskVal1AndEnsureMaskval1OrMaskVal3AreSet_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Read attribute INT32U Value MinValue Constraints\n"); - err = TestReadAttributeInt32uValueMinValueConstraints_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : Write attribute BITMAP32 Back to Default Value\n"); + err = TestWriteAttributeBitmap32BackToDefaultValue_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Read attribute INT32U Value MaxValue Constraints\n"); - err = TestReadAttributeInt32uValueMaxValueConstraints_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Write attribute INT32U Value\n"); + err = TestWriteAttributeInt32uValue_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Read attribute INT32U Value NotValue Constraints\n"); - err = TestReadAttributeInt32uValueNotValueConstraints_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : Read attribute INT32U Value MinValue Constraints\n"); + err = TestReadAttributeInt32uValueMinValueConstraints_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Write attribute INT32U Value Back to Default Value\n"); - err = TestWriteAttributeInt32uValueBackToDefaultValue_16(); + ChipLogProgress(chipTool, " ***** Test Step 16 : Read attribute INT32U Value MaxValue Constraints\n"); + err = TestReadAttributeInt32uValueMaxValueConstraints_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Write attribute CHAR_STRING Value\n"); - err = TestWriteAttributeCharStringValue_17(); + ChipLogProgress(chipTool, " ***** Test Step 17 : Read attribute INT32U Value NotValue Constraints\n"); + err = TestReadAttributeInt32uValueNotValueConstraints_17(); break; case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Read attribute CHAR_STRING Value MinLength Constraints\n"); - err = TestReadAttributeCharStringValueMinLengthConstraints_18(); + ChipLogProgress(chipTool, " ***** Test Step 18 : Write attribute INT32U Value Back to Default Value\n"); + err = TestWriteAttributeInt32uValueBackToDefaultValue_18(); break; case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Read attribute CHAR_STRING Value MaxLength Constraints\n"); - err = TestReadAttributeCharStringValueMaxLengthConstraints_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 StartsWith Constraints\n"); - err = TestReadAttributeCharStringValueStartsWithConstraints_20(); + ChipLogProgress(chipTool, " ***** Test Step 20 : Read attribute CHAR_STRING Value MinLength Constraints\n"); + err = TestReadAttributeCharStringValueMinLengthConstraints_20(); break; case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Read attribute CHAR_STRING Value EndsWith Constraints\n"); - err = TestReadAttributeCharStringValueEndsWithConstraints_21(); + ChipLogProgress(chipTool, " ***** Test Step 21 : Read attribute CHAR_STRING Value MaxLength Constraints\n"); + err = TestReadAttributeCharStringValueMaxLengthConstraints_21(); break; case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Write attribute CHAR_STRING Value\n"); - err = TestWriteAttributeCharStringValue_22(); + ChipLogProgress(chipTool, " ***** Test Step 22 : Read attribute CHAR_STRING Value StartsWith Constraints\n"); + err = TestReadAttributeCharStringValueStartsWithConstraints_22(); break; case 23: - ChipLogProgress( - chipTool, " ***** Test Step 23 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); - err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_23(); + ChipLogProgress(chipTool, " ***** Test Step 23 : Read attribute CHAR_STRING Value EndsWith Constraints\n"); + err = TestReadAttributeCharStringValueEndsWithConstraints_23(); break; case 24: ChipLogProgress(chipTool, " ***** Test Step 24 : Write attribute CHAR_STRING Value\n"); @@ -104237,8 +104237,8 @@ class TestConstraints : public TestCommandBridge { err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_27(); break; case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Write attribute CHAR_STRING Value with only digits\n"); - err = TestWriteAttributeCharStringValueWithOnlyDigits_28(); + ChipLogProgress(chipTool, " ***** Test Step 28 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_28(); break; case 29: ChipLogProgress( @@ -104246,8 +104246,8 @@ class TestConstraints : public TestCommandBridge { err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_29(); break; case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Write attribute CHAR_STRING Value with only non-letters\n"); - err = TestWriteAttributeCharStringValueWithOnlyNonLetters_30(); + ChipLogProgress(chipTool, " ***** Test Step 30 : Write attribute CHAR_STRING Value with only digits\n"); + err = TestWriteAttributeCharStringValueWithOnlyDigits_30(); break; case 31: ChipLogProgress( @@ -104255,9 +104255,8 @@ class TestConstraints : public TestCommandBridge { err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_31(); break; case 32: - ChipLogProgress( - chipTool, " ***** Test Step 32 : Write attribute CHAR_STRING Value with uppercase letters and symbols\n"); - err = TestWriteAttributeCharStringValueWithUppercaseLettersAndSymbols_32(); + ChipLogProgress(chipTool, " ***** Test Step 32 : Write attribute CHAR_STRING Value with only non-letters\n"); + err = TestWriteAttributeCharStringValueWithOnlyNonLetters_32(); break; case 33: ChipLogProgress( @@ -104266,8 +104265,8 @@ class TestConstraints : public TestCommandBridge { break; case 34: ChipLogProgress( - chipTool, " ***** Test Step 34 : Write attribute CHAR_STRING Value with lowercase letters and symbols\n"); - err = TestWriteAttributeCharStringValueWithLowercaseLettersAndSymbols_34(); + chipTool, " ***** Test Step 34 : Write attribute CHAR_STRING Value with uppercase letters and symbols\n"); + err = TestWriteAttributeCharStringValueWithUppercaseLettersAndSymbols_34(); break; case 35: ChipLogProgress( @@ -104275,8 +104274,9 @@ class TestConstraints : public TestCommandBridge { err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_35(); break; case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : Write attribute CHAR_STRING Value which is empty\n"); - err = TestWriteAttributeCharStringValueWhichIsEmpty_36(); + ChipLogProgress( + chipTool, " ***** Test Step 36 : Write attribute CHAR_STRING Value with lowercase letters and symbols\n"); + err = TestWriteAttributeCharStringValueWithLowercaseLettersAndSymbols_36(); break; case 37: ChipLogProgress( @@ -104284,12 +104284,13 @@ class TestConstraints : public TestCommandBridge { err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_37(); break; case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : Write attribute CHAR_STRING Value\n"); - err = TestWriteAttributeCharStringValue_38(); + ChipLogProgress(chipTool, " ***** Test Step 38 : Write attribute CHAR_STRING Value which is empty\n"); + err = TestWriteAttributeCharStringValueWhichIsEmpty_38(); break; case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : Read attribute CHAR_STRING Value isHexString Constraints\n"); - err = TestReadAttributeCharStringValueIsHexStringConstraints_39(); + ChipLogProgress( + chipTool, " ***** Test Step 39 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); + err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_39(); break; case 40: ChipLogProgress(chipTool, " ***** Test Step 40 : Write attribute CHAR_STRING Value\n"); @@ -104300,44 +104301,44 @@ class TestConstraints : public TestCommandBridge { err = TestReadAttributeCharStringValueIsHexStringConstraints_41(); break; case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : Write attribute CHAR_STRING Value Back to Default Value\n"); - err = TestWriteAttributeCharStringValueBackToDefaultValue_42(); + ChipLogProgress(chipTool, " ***** Test Step 42 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_42(); break; case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Read attribute NULLABLE_INT8U Default Value\n"); - err = TestReadAttributeNullableInt8uDefaultValue_43(); + ChipLogProgress(chipTool, " ***** Test Step 43 : Read attribute CHAR_STRING Value isHexString Constraints\n"); + err = TestReadAttributeCharStringValueIsHexStringConstraints_43(); break; case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : Write attribute NULLABLE_INT8U with a value\n"); - err = TestWriteAttributeNullableInt8uWithAValue_44(); + ChipLogProgress(chipTool, " ***** Test Step 44 : Write attribute CHAR_STRING Value Back to Default Value\n"); + err = TestWriteAttributeCharStringValueBackToDefaultValue_44(); break; case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Read attribute NULLABLE_INT8U with a value\n"); - err = TestReadAttributeNullableInt8uWithAValue_45(); + ChipLogProgress(chipTool, " ***** Test Step 45 : Read attribute NULLABLE_INT8U Default Value\n"); + err = TestReadAttributeNullableInt8uDefaultValue_45(); break; case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : Write attribute NULLABLE_INT8U without a value\n"); - err = TestWriteAttributeNullableInt8uWithoutAValue_46(); + ChipLogProgress(chipTool, " ***** Test Step 46 : Write attribute NULLABLE_INT8U with a value\n"); + err = TestWriteAttributeNullableInt8uWithAValue_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(); + ChipLogProgress(chipTool, " ***** Test Step 48 : Write attribute NULLABLE_INT8U without a value\n"); + err = TestWriteAttributeNullableInt8uWithoutAValue_48(); break; case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Read attribute NULLABLE_OCTET_STRING Default Value\n"); - err = TestReadAttributeNullableOctetStringDefaultValue_49(); + ChipLogProgress(chipTool, " ***** Test Step 49 : Read attribute NULLABLE_INT8U with a value\n"); + err = TestReadAttributeNullableInt8uWithAValue_49(); break; case 50: - ChipLogProgress(chipTool, " ***** Test Step 50 : Write attribute NULLABLE_OCTET_STRING\n"); - err = TestWriteAttributeNullableOctetString_50(); + ChipLogProgress(chipTool, " ***** Test Step 50 : Write attribute NULLABLE_INT8U back to Default Value\n"); + err = TestWriteAttributeNullableInt8uBackToDefaultValue_50(); break; case 51: - ChipLogProgress(chipTool, " ***** Test Step 51 : Read attribute NULLABLE_OCTET_STRING\n"); - err = TestReadAttributeNullableOctetString_51(); + ChipLogProgress(chipTool, " ***** Test Step 51 : Read attribute NULLABLE_OCTET_STRING Default Value\n"); + err = TestReadAttributeNullableOctetStringDefaultValue_51(); break; case 52: ChipLogProgress(chipTool, " ***** Test Step 52 : Write attribute NULLABLE_OCTET_STRING\n"); @@ -104348,8 +104349,16 @@ class TestConstraints : public TestCommandBridge { err = TestReadAttributeNullableOctetString_53(); break; case 54: - ChipLogProgress(chipTool, " ***** Test Step 54 : Write attribute NULLABLE_OCTET_STRING back to Default Value\n"); - err = TestWriteAttributeNullableOctetStringBackToDefaultValue_54(); + ChipLogProgress(chipTool, " ***** Test Step 54 : Write attribute NULLABLE_OCTET_STRING\n"); + err = TestWriteAttributeNullableOctetString_54(); + break; + case 55: + ChipLogProgress(chipTool, " ***** Test Step 55 : Read attribute NULLABLE_OCTET_STRING\n"); + err = TestReadAttributeNullableOctetString_55(); + break; + case 56: + ChipLogProgress(chipTool, " ***** Test Step 56 : Write attribute NULLABLE_OCTET_STRING back to Default Value\n"); + err = TestWriteAttributeNullableOctetStringBackToDefaultValue_56(); break; } @@ -104527,6 +104536,12 @@ class TestConstraints : public TestCommandBridge { case 54: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -104540,7 +104555,7 @@ class TestConstraints : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 55; + const uint16_t mTestCount = 57; chip::Optional mNodeId; chip::Optional mCluster; @@ -104786,7 +104801,51 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap32BackToDefaultValue_11() + CHIP_ERROR TestWriteAttributeBitmap32WithMaskVal1_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id bitmap32Argument; + bitmap32Argument = [NSNumber numberWithUnsignedInt:1UL]; + [cluster writeAttributeBitmap32WithValue:bitmap32Argument + completion:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP32 with MaskVal1 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap32WithMaskVal1AndEnsureMaskval1OrMaskVal3AreSet_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap32WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP32 with MaskVal1 and ensure Maskval1 or MaskVal3 are set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap32", actualValue, 1UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBitmap32BackToDefaultValue_13() { MTRBaseDevice * device = GetDevice("alpha"); @@ -104807,7 +104866,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32uValue_12() + CHIP_ERROR TestWriteAttributeInt32uValue_14() { MTRBaseDevice * device = GetDevice("alpha"); @@ -104828,7 +104887,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32uValueMinValueConstraints_13() + CHIP_ERROR TestReadAttributeInt32uValueMinValueConstraints_15() { MTRBaseDevice * device = GetDevice("alpha"); @@ -104848,7 +104907,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32uValueMaxValueConstraints_14() + CHIP_ERROR TestReadAttributeInt32uValueMaxValueConstraints_16() { MTRBaseDevice * device = GetDevice("alpha"); @@ -104868,7 +104927,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32uValueNotValueConstraints_15() + CHIP_ERROR TestReadAttributeInt32uValueNotValueConstraints_17() { MTRBaseDevice * device = GetDevice("alpha"); @@ -104888,7 +104947,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32uValueBackToDefaultValue_16() + CHIP_ERROR TestWriteAttributeInt32uValueBackToDefaultValue_18() { MTRBaseDevice * device = GetDevice("alpha"); @@ -104909,7 +104968,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_17() + CHIP_ERROR TestWriteAttributeCharStringValue_19() { MTRBaseDevice * device = GetDevice("alpha"); @@ -104930,7 +104989,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueMinLengthConstraints_18() + CHIP_ERROR TestReadAttributeCharStringValueMinLengthConstraints_20() { MTRBaseDevice * device = GetDevice("alpha"); @@ -104949,7 +105008,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueMaxLengthConstraints_19() + CHIP_ERROR TestReadAttributeCharStringValueMaxLengthConstraints_21() { MTRBaseDevice * device = GetDevice("alpha"); @@ -104968,7 +105027,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueStartsWithConstraints_20() + CHIP_ERROR TestReadAttributeCharStringValueStartsWithConstraints_22() { MTRBaseDevice * device = GetDevice("alpha"); @@ -104987,7 +105046,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueEndsWithConstraints_21() + CHIP_ERROR TestReadAttributeCharStringValueEndsWithConstraints_23() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105006,7 +105065,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_22() + CHIP_ERROR TestWriteAttributeCharStringValue_24() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105027,7 +105086,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_23() + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_25() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105047,7 +105106,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_24() + CHIP_ERROR TestWriteAttributeCharStringValue_26() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105068,7 +105127,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_25() + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_27() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105088,7 +105147,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_26() + CHIP_ERROR TestWriteAttributeCharStringValue_28() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105109,7 +105168,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_27() + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_29() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105129,7 +105188,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValueWithOnlyDigits_28() + CHIP_ERROR TestWriteAttributeCharStringValueWithOnlyDigits_30() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105150,7 +105209,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_29() + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_31() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105170,7 +105229,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValueWithOnlyNonLetters_30() + CHIP_ERROR TestWriteAttributeCharStringValueWithOnlyNonLetters_32() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105191,7 +105250,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_31() + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_33() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105211,7 +105270,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValueWithUppercaseLettersAndSymbols_32() + CHIP_ERROR TestWriteAttributeCharStringValueWithUppercaseLettersAndSymbols_34() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105233,7 +105292,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_33() + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_35() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105253,7 +105312,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValueWithLowercaseLettersAndSymbols_34() + CHIP_ERROR TestWriteAttributeCharStringValueWithLowercaseLettersAndSymbols_36() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105275,7 +105334,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_35() + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_37() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105295,7 +105354,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValueWhichIsEmpty_36() + CHIP_ERROR TestWriteAttributeCharStringValueWhichIsEmpty_38() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105316,7 +105375,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_37() + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_39() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105336,7 +105395,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_38() + CHIP_ERROR TestWriteAttributeCharStringValue_40() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105357,7 +105416,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_39() + CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_41() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105376,7 +105435,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_40() + CHIP_ERROR TestWriteAttributeCharStringValue_42() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105397,7 +105456,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_41() + CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_43() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105416,7 +105475,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValueBackToDefaultValue_42() + CHIP_ERROR TestWriteAttributeCharStringValueBackToDefaultValue_44() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105437,7 +105496,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uDefaultValue_43() + CHIP_ERROR TestReadAttributeNullableInt8uDefaultValue_45() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105461,7 +105520,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8uWithAValue_44() + CHIP_ERROR TestWriteAttributeNullableInt8uWithAValue_46() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105482,7 +105541,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uWithAValue_45() + CHIP_ERROR TestReadAttributeNullableInt8uWithAValue_47() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105503,7 +105562,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8uWithoutAValue_46() + CHIP_ERROR TestWriteAttributeNullableInt8uWithoutAValue_48() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105524,7 +105583,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uWithAValue_47() + CHIP_ERROR TestReadAttributeNullableInt8uWithAValue_49() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105545,7 +105604,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8uBackToDefaultValue_48() + CHIP_ERROR TestWriteAttributeNullableInt8uBackToDefaultValue_50() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105566,7 +105625,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableOctetStringDefaultValue_49() + CHIP_ERROR TestReadAttributeNullableOctetStringDefaultValue_51() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105591,7 +105650,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableOctetString_50() + CHIP_ERROR TestWriteAttributeNullableOctetString_52() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105612,7 +105671,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableOctetString_51() + CHIP_ERROR TestReadAttributeNullableOctetString_53() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105633,7 +105692,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableOctetString_52() + CHIP_ERROR TestWriteAttributeNullableOctetString_54() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105654,7 +105713,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableOctetString_53() + CHIP_ERROR TestReadAttributeNullableOctetString_55() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105675,7 +105734,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableOctetStringBackToDefaultValue_54() + CHIP_ERROR TestWriteAttributeNullableOctetStringBackToDefaultValue_56() { MTRBaseDevice * device = GetDevice("alpha");