From 2794137fa1840bc3fb6ad622e022093611bb0f13 Mon Sep 17 00:00:00 2001 From: ManjunathRA Date: Thu, 24 Mar 2022 21:54:36 +0530 Subject: [PATCH] Test modified Mar 17 (#16367) * Modified scripts TC-CC-2.1 TC-CC-9.1 * Added auto generated files * Modified script after rebase * Auto generated files after rebase --- .../suites/certification/Test_TC_CC_2_1.yaml | 164 ++++++--- .../suites/certification/Test_TC_CC_9_2.yaml | 18 +- .../suites/certification/Test_TC_MC_9_1.yaml | 3 +- .../Framework/CHIPTests/CHIPClustersTests.m | 316 +++++++++++------ .../zap-generated/test/Commands.h | 318 ++++++++++-------- .../chip-tool/zap-generated/test/Commands.h | 231 +++++++------ 6 files changed, 650 insertions(+), 400 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_CC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_2_1.yaml index 27cef7c45f7665..8ae7aeb41dac1f 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_2_1.yaml @@ -49,7 +49,10 @@ tests: command: "readAttribute" attribute: "current hue" response: - value: 0 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Validate constraints of attribute: CurrentSaturation" command: "readAttribute" @@ -72,7 +75,10 @@ tests: command: "readAttribute" attribute: "current saturation" response: - value: 0 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Validate constraints of attribute: CurrentX" command: "readAttribute" @@ -95,7 +101,10 @@ tests: command: "readAttribute" attribute: "current x" response: - value: 24939 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Validate constraints of attribute: CurrentY" command: "readAttribute" @@ -118,7 +127,10 @@ tests: command: "readAttribute" attribute: "current y" response: - value: 24701 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Validate constraints of attribute: ColorTemperatureMireds" command: "readAttribute" @@ -145,7 +157,10 @@ tests: command: "readAttribute" attribute: "color temperature" response: - value: 250 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Validate constraints of attribute: ColorMode" command: "readAttribute" @@ -170,7 +185,10 @@ tests: command: "readAttribute" attribute: "color mode" response: - value: 1 + constraints: + type: enum8 + minValue: 0 + maxValue: 2 - label: "Validate constraints of attribute: Options" command: "readAttribute" @@ -211,7 +229,8 @@ tests: command: "readAttribute" attribute: "enhanced current hue" response: - value: 0 + constraints: + type: uint16 - label: "Validate constraints of attribute: EnhancedColorMode" command: "readAttribute" @@ -235,7 +254,8 @@ tests: command: "readAttribute" attribute: "enhanced color mode" response: - value: 1 + constraints: + type: enum8 - label: "Validate constraints of attribute: ColorLoopActive" command: "readAttribute" @@ -256,7 +276,8 @@ tests: command: "readAttribute" attribute: "color loop active" response: - value: 0 + constraints: + type: uint8 - label: "Validate constraints of attribute: ColorLoopDirection" command: "readAttribute" @@ -278,7 +299,8 @@ tests: command: "readAttribute" attribute: "color loop direction" response: - value: 0 + constraints: + type: uint8 - label: "Validate constraints of attribute: ColorLoopTime" command: "readAttribute" @@ -299,7 +321,8 @@ tests: command: "readAttribute" attribute: "color loop time" response: - value: 25 + constraints: + type: uint16 - label: "Validate constraints of attribute: ColorLoopStartEnhancedHue" command: "readAttribute" @@ -322,7 +345,8 @@ tests: command: "readAttribute" attribute: "color loop start enhanced hue" response: - value: 8960 + constraints: + type: uint16 - label: "Validate constraints of attribute: ColorLoopStoredEnhancedHue" command: "readAttribute" @@ -345,7 +369,8 @@ tests: command: "readAttribute" attribute: "color loop stored enhanced hue" response: - value: 0 + constraints: + type: uint16 - label: "Validate constraints of attribute: ColorCapabilities" command: "readAttribute" @@ -369,7 +394,10 @@ tests: command: "readAttribute" attribute: "color capabilities" response: - value: 0 + constraints: + type: map16 + minValue: 0 + maxValue: 31 - label: "Validate constraints of attribute: ColorTempPhysicalMinMireds" command: "readAttribute" @@ -394,7 +422,10 @@ tests: command: "readAttribute" attribute: "color temp physical min" response: - value: 0 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Validate constraints of attribute: ColorTempPhysicalMaxMireds" command: "readAttribute" @@ -419,7 +450,10 @@ tests: command: "readAttribute" attribute: "color temp physical max" response: - value: 65279 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Read the optional attribute: CoupleColorTempToLevelMinMireds" optional: true @@ -445,7 +479,8 @@ tests: command: "readAttribute" attribute: "couple color temp to level min-mireds" response: - value: 0 + constraints: + type: uint16 - label: "Read the optional attribute: StartUpColorTemperatureMireds" optional: true @@ -495,7 +530,8 @@ tests: command: "readAttribute" attribute: "remaining time" response: - value: 0 + constraints: + type: uint16 - label: "Read the optional attribute: DriftCompensation" optional: true @@ -521,7 +557,10 @@ tests: command: "readAttribute" attribute: "drift compensation" response: - value: 0 + constraints: + type: enum8 + minValue: 0 + maxValue: 4 - label: "Read the optional attribute: CompensationText" optional: true @@ -546,7 +585,9 @@ tests: command: "readAttribute" attribute: "compensation text" response: - value: "" + constraints: + type: string + maxLength: 254 #Defined Primaries Information Attribute Set @@ -571,7 +612,10 @@ tests: command: "readAttribute" attribute: "number of primaries" response: - value: 0 + constraints: + type: uint8 + minValue: 0 + maxValue: 6 - label: "Read the mandatory attribute: Primary1X" command: "readAttribute" @@ -594,7 +638,10 @@ tests: command: "readAttribute" attribute: "primary 1 x" response: - value: 0 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Read the mandatory attribute: Primary1Y" command: "readAttribute" @@ -617,7 +664,10 @@ tests: command: "readAttribute" attribute: "primary 1 y" response: - value: 0 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Read the mandatory attribute: Primary1Intensity" command: "readAttribute" @@ -640,7 +690,8 @@ tests: command: "readAttribute" attribute: "primary 1 intensity" response: - value: 0 + constraints: + type: uint8 - label: "Read the mandatory attribute: Primary2X" command: "readAttribute" @@ -663,7 +714,10 @@ tests: command: "readAttribute" attribute: "primary 2 x" response: - value: 0 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Read the mandatory attribute: Primary2Y" command: "readAttribute" @@ -686,7 +740,10 @@ tests: command: "readAttribute" attribute: "primary 2 y" response: - value: 0 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Validate constraints of attribute: Primary2Intensity" command: "readAttribute" @@ -709,7 +766,8 @@ tests: command: "readAttribute" attribute: "primary 2 intensity" response: - value: 0 + constraints: + type: uint8 - label: "Read the mandatory attribute: Primary3X" command: "readAttribute" @@ -732,7 +790,10 @@ tests: command: "readAttribute" attribute: "primary 3 x" response: - value: 0 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Read the mandatory attribute: Primary3Y" command: "readAttribute" @@ -755,7 +816,10 @@ tests: command: "readAttribute" attribute: "primary 3 y" response: - value: 0 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Read the mandatory attribute: Primary3Intensity" command: "readAttribute" @@ -778,7 +842,8 @@ tests: command: "readAttribute" attribute: "primary 3 intensity" response: - value: 0 + constraints: + type: uint8 #Additional Defined Primaries Information Attribute Set - label: "Read the mandatory attribute: Primary4X" @@ -802,7 +867,10 @@ tests: command: "readAttribute" attribute: "primary 4 x" response: - value: 0 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Read the mandatory attribute: Primary4Y" command: "readAttribute" @@ -825,7 +893,10 @@ tests: command: "readAttribute" attribute: "primary 4 y" response: - value: 0 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Read the mandatory attribute: Primary4Intensity" command: "readAttribute" @@ -848,7 +919,8 @@ tests: command: "readAttribute" attribute: "primary 4 intensity" response: - value: 0 + constraints: + type: uint8 - label: "Read the mandatory attribute: Primary5X" command: "readAttribute" @@ -871,7 +943,10 @@ tests: command: "readAttribute" attribute: "primary 5 x" response: - value: 0 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Read the mandatory attribute: Primary5Y" command: "readAttribute" @@ -894,7 +969,10 @@ tests: command: "readAttribute" attribute: "primary 5 y" response: - value: 0 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Read the mandatory attribute: Primary5Intensity" command: "readAttribute" @@ -917,7 +995,8 @@ tests: command: "readAttribute" attribute: "primary 5 intensity" response: - value: 0 + constraints: + type: uint8 - label: "Read the mandatory attribute: Primary6X" command: "readAttribute" @@ -940,7 +1019,10 @@ tests: command: "readAttribute" attribute: "primary 6 x" response: - value: 0 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Read the mandatory attribute: Primary6Y" command: "readAttribute" @@ -963,7 +1045,10 @@ tests: command: "readAttribute" attribute: "primary 6 y" response: - value: 0 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Read the mandatory attribute: Primary6Intensity" command: "readAttribute" @@ -986,7 +1071,8 @@ tests: command: "readAttribute" attribute: "primary 6 intensity" response: - value: 0 + constraints: + type: uint8 #Defined Color Points Settings Attribute Set - label: "Read the optional attribute: WhitePointX" diff --git a/src/app/tests/suites/certification/Test_TC_CC_9_2.yaml b/src/app/tests/suites/certification/Test_TC_CC_9_2.yaml index 3fb80d1b146c4d..6f7a92c62f4030 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_9_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_9_2.yaml @@ -89,6 +89,15 @@ tests: response: value: 160 + - label: "Read EnhancedCurrentHue attribute from DUT." + command: "readAttribute" + attribute: "enhanced current hue" + PICS: A_ENHANCEDCURRENTHUE + response: + saveAs: EnhancedCurrentHueValue + constraints: + type: uint16 + - label: "Color Loop Set Command - Set all Attributes" command: "ColorLoopSet" PICS: CR_COLORLOOPSET @@ -116,15 +125,6 @@ tests: response: value: 1 - - label: "Read EnhancedCurrentHue attribute from DUT." - command: "readAttribute" - attribute: "enhanced current hue" - PICS: A_ENHANCEDCURRENTHUE - response: - saveAs: EnhancedCurrentHueValue - constraints: - type: uint16 - - label: "Read ColorLoopStoredEnhancedHue attribute from DUT." command: "readAttribute" attribute: "color loop stored enhanced hue" diff --git a/src/app/tests/suites/certification/Test_TC_MC_9_1.yaml b/src/app/tests/suites/certification/Test_TC_MC_9_1.yaml index 2eb32092e047c1..e6cb59e61aada3 100644 --- a/src/app/tests/suites/certification/Test_TC_MC_9_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_MC_9_1.yaml @@ -44,13 +44,12 @@ tests: response: constraints: type: string - maxLenght: 32 + maxLength: 32 - label: "Reads the VendorID attribute" command: "readAttribute" attribute: "VendorID" response: - value: 0 constraints: type: vendor-id saveAs: vendorID diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index acc67d4f028669..d01a4df9ede1f3 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -2361,7 +2361,15 @@ - (void)testSendClusterTest_TC_CC_2_1_000003_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 254); + } } [expectation fulfill]; @@ -2440,7 +2448,15 @@ - (void)testSendClusterTest_TC_CC_2_1_000006_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 254); + } } [expectation fulfill]; @@ -2517,7 +2533,15 @@ - (void)testSendClusterTest_TC_CC_2_1_000009_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 24939U); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -2595,7 +2619,15 @@ - (void)testSendClusterTest_TC_CC_2_1_000012_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 24701U); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -2790,11 +2822,6 @@ - (void)testSendClusterTest_TC_CC_2_1_000020_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - [expectation fulfill]; }]; @@ -2875,11 +2902,6 @@ - (void)testSendClusterTest_TC_CC_2_1_000024_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - [expectation fulfill]; }]; @@ -2942,11 +2964,6 @@ - (void)testSendClusterTest_TC_CC_2_1_000027_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - [expectation fulfill]; }]; @@ -3008,11 +3025,6 @@ - (void)testSendClusterTest_TC_CC_2_1_000030_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 25U); - } - [expectation fulfill]; }]; @@ -3078,11 +3090,6 @@ - (void)testSendClusterTest_TC_CC_2_1_000033_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 8960U); - } - [expectation fulfill]; }]; @@ -3148,11 +3155,6 @@ - (void)testSendClusterTest_TC_CC_2_1_000036_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - [expectation fulfill]; }]; @@ -3229,7 +3231,15 @@ - (void)testSendClusterTest_TC_CC_2_1_000039_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 31U); + } } [expectation fulfill]; @@ -3313,7 +3323,15 @@ - (void)testSendClusterTest_TC_CC_2_1_000042_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -3397,7 +3415,15 @@ - (void)testSendClusterTest_TC_CC_2_1_000045_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 65279U); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -3483,11 +3509,6 @@ - (void)testSendClusterTest_TC_CC_2_1_000048_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - [expectation fulfill]; }]; @@ -3666,11 +3687,6 @@ - (void)testSendClusterTest_TC_CC_2_1_000054_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - [expectation fulfill]; }]; @@ -3763,7 +3779,15 @@ - (void)testSendClusterTest_TC_CC_2_1_000057_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 4); + } } [expectation fulfill]; @@ -3850,7 +3874,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000060_ReadAttribute { id actualValue = value; - XCTAssertTrue([actualValue isEqualToString:@""]); + XCTAssertLessThanOrEqual([actualValue length], 254); } [expectation fulfill]; @@ -3928,7 +3952,15 @@ - (void)testSendClusterTest_TC_CC_2_1_000063_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 6); + } } [expectation fulfill]; @@ -4005,7 +4037,15 @@ - (void)testSendClusterTest_TC_CC_2_1_000066_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -4082,7 +4122,15 @@ - (void)testSendClusterTest_TC_CC_2_1_000069_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -4178,7 +4226,15 @@ - (void)testSendClusterTest_TC_CC_2_1_000073_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -4255,7 +4311,15 @@ - (void)testSendClusterTest_TC_CC_2_1_000076_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -4351,7 +4415,15 @@ - (void)testSendClusterTest_TC_CC_2_1_000080_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -4428,7 +4500,15 @@ - (void)testSendClusterTest_TC_CC_2_1_000083_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -4524,7 +4604,15 @@ - (void)testSendClusterTest_TC_CC_2_1_000087_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -4601,7 +4689,15 @@ - (void)testSendClusterTest_TC_CC_2_1_000090_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -4697,7 +4793,15 @@ - (void)testSendClusterTest_TC_CC_2_1_000094_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -4774,7 +4878,15 @@ - (void)testSendClusterTest_TC_CC_2_1_000097_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -4870,7 +4982,15 @@ - (void)testSendClusterTest_TC_CC_2_1_000101_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -4947,7 +5067,15 @@ - (void)testSendClusterTest_TC_CC_2_1_000104_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -10745,7 +10873,32 @@ - (void)testSendClusterTest_TC_CC_9_2_000007_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_2_000008_ColorLoopSet +NSNumber * _Nonnull EnhancedCurrentHueValue; +- (void)testSendClusterTest_TC_CC_9_2_000008_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT."]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read EnhancedCurrentHue attribute from DUT. Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + EnhancedCurrentHueValue = actualValue; + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_2_000009_ColorLoopSet { XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Set all Attributes"]; @@ -10773,7 +10926,7 @@ - (void)testSendClusterTest_TC_CC_9_2_000008_ColorLoopSet [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_2_000009_ReadAttribute +- (void)testSendClusterTest_TC_CC_9_2_000010_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT."]; @@ -10797,31 +10950,6 @@ - (void)testSendClusterTest_TC_CC_9_2_000009_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -NSNumber * _Nonnull EnhancedCurrentHueValue; -- (void)testSendClusterTest_TC_CC_9_2_000010_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT."]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read EnhancedCurrentHue attribute from DUT. Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - EnhancedCurrentHueValue = actualValue; - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - (void)testSendClusterTest_TC_CC_9_2_000011_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT."]; @@ -16437,6 +16565,11 @@ - (void)testSendClusterTest_TC_MC_9_1_000002_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + XCTAssertLessThanOrEqual([actualValue length], 32); + } + [expectation fulfill]; }]; @@ -16456,11 +16589,6 @@ - (void)testSendClusterTest_TC_MC_9_1_000003_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - [expectation fulfill]; }]; diff --git a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h index 44fcafab7368ef..b5a321a5a7673f 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h @@ -3594,9 +3594,12 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("current hue", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); } NextTest(); @@ -3661,9 +3664,12 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("current saturation", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); } NextTest(); @@ -3727,9 +3733,12 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("current x", actualValue, 24939U)); + VerifyOrReturn(CheckConstraintType("currentX", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentX", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentX", [value unsignedShortValue], 65279U)); } NextTest(); @@ -3793,9 +3802,12 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("current y", actualValue, 24701U)); + VerifyOrReturn(CheckConstraintType("currentY", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentY", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentY", [value unsignedShortValue], 65279U)); } NextTest(); @@ -3963,11 +3975,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("enhanced current hue", actualValue, 0U)); - } - + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); NextTest(); }]; @@ -4040,11 +4048,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color loop active", actualValue, 0)); - } - + VerifyOrReturn(CheckConstraintType("colorLoopActive", "", "uint8")); NextTest(); }]; @@ -4100,11 +4104,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color loop direction", actualValue, 0)); - } - + VerifyOrReturn(CheckConstraintType("colorLoopDirection", "", "uint8")); NextTest(); }]; @@ -4159,11 +4159,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color loop time", actualValue, 25U)); - } - + VerifyOrReturn(CheckConstraintType("colorLoopTime", "", "uint16")); NextTest(); }]; @@ -4222,11 +4218,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color loop start enhanced hue", actualValue, 8960U)); - } - + VerifyOrReturn(CheckConstraintType("colorLoopStartEnhancedHue", "", "uint16")); NextTest(); }]; @@ -4285,11 +4277,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color loop stored enhanced hue", actualValue, 0U)); - } - + VerifyOrReturn(CheckConstraintType("colorLoopStoredEnhancedHue", "", "uint16")); NextTest(); }]; @@ -4352,9 +4340,12 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color capabilities", actualValue, 0U)); + VerifyOrReturn(CheckConstraintType("colorCapabilities", "", "map16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorCapabilities", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorCapabilities", [value unsignedShortValue], 31U)); } NextTest(); @@ -4420,9 +4411,12 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color temp physical min", actualValue, 0U)); + VerifyOrReturn(CheckConstraintType("colorTempPhysicalMin", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTempPhysicalMin", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTempPhysicalMin", [value unsignedShortValue], 65279U)); } NextTest(); @@ -4488,9 +4482,12 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color temp physical max", actualValue, 65279U)); + VerifyOrReturn(CheckConstraintType("colorTempPhysicalMax", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTempPhysicalMax", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTempPhysicalMax", [value unsignedShortValue], 65279U)); } NextTest(); @@ -4567,11 +4564,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("couple color temp to level min-mireds", actualValue, 0U)); - } - + VerifyOrReturn(CheckConstraintType("coupleColorTempToLevelMinMireds", "", "uint16")); NextTest(); }]; @@ -4728,11 +4721,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("remaining time", actualValue, 0U)); - } - + VerifyOrReturn(CheckConstraintType("remainingTime", "", "uint16")); NextTest(); }]; @@ -4810,9 +4799,12 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("drift compensation", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("driftCompensation", "", "enum8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("driftCompensation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("driftCompensation", [value unsignedCharValue], 4)); } NextTest(); @@ -4886,11 +4878,8 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("compensation text", actualValue, @"")); - } - + VerifyOrReturn(CheckConstraintType("compensationText", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("compensationText", [value length], 254)); NextTest(); }]; @@ -4952,9 +4941,12 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("number of primaries", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("numberOfPrimaries", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("numberOfPrimaries", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("numberOfPrimaries", [value unsignedCharValue], 6)); } NextTest(); @@ -5018,9 +5010,12 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("primary 1 x", actualValue, 0U)); + VerifyOrReturn(CheckConstraintType("primary1X", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("primary1X", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("primary1X", [value unsignedShortValue], 65279U)); } NextTest(); @@ -5084,9 +5079,12 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("primary 1 y", actualValue, 0U)); + VerifyOrReturn(CheckConstraintType("primary1Y", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("primary1Y", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("primary1Y", [value unsignedShortValue], 65279U)); } NextTest(); @@ -5168,9 +5166,12 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("primary 2 x", actualValue, 0U)); + VerifyOrReturn(CheckConstraintType("primary2X", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("primary2X", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("primary2X", [value unsignedShortValue], 65279U)); } NextTest(); @@ -5234,9 +5235,12 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("primary 2 y", actualValue, 0U)); + VerifyOrReturn(CheckConstraintType("primary2Y", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("primary2Y", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("primary2Y", [value unsignedShortValue], 65279U)); } NextTest(); @@ -5318,9 +5322,12 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("primary 3 x", actualValue, 0U)); + VerifyOrReturn(CheckConstraintType("primary3X", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("primary3X", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("primary3X", [value unsignedShortValue], 65279U)); } NextTest(); @@ -5384,9 +5391,12 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("primary 3 y", actualValue, 0U)); + VerifyOrReturn(CheckConstraintType("primary3Y", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("primary3Y", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("primary3Y", [value unsignedShortValue], 65279U)); } NextTest(); @@ -5468,9 +5478,12 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("primary 4 x", actualValue, 0U)); + VerifyOrReturn(CheckConstraintType("primary4X", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("primary4X", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("primary4X", [value unsignedShortValue], 65279U)); } NextTest(); @@ -5534,9 +5547,12 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("primary 4 y", actualValue, 0U)); + VerifyOrReturn(CheckConstraintType("primary4Y", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("primary4Y", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("primary4Y", [value unsignedShortValue], 65279U)); } NextTest(); @@ -5618,9 +5634,12 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("primary 5 x", actualValue, 0U)); + VerifyOrReturn(CheckConstraintType("primary5X", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("primary5X", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("primary5X", [value unsignedShortValue], 65279U)); } NextTest(); @@ -5684,9 +5703,12 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("primary 5 y", actualValue, 0U)); + VerifyOrReturn(CheckConstraintType("primary5Y", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("primary5Y", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("primary5Y", [value unsignedShortValue], 65279U)); } NextTest(); @@ -5768,9 +5790,12 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("primary 6 x", actualValue, 0U)); + VerifyOrReturn(CheckConstraintType("primary6X", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("primary6X", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("primary6X", [value unsignedShortValue], 65279U)); } NextTest(); @@ -5834,9 +5859,12 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("primary 6 y", actualValue, 0U)); + VerifyOrReturn(CheckConstraintType("primary6Y", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("primary6Y", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("primary6Y", [value unsignedShortValue], 65279U)); } NextTest(); @@ -13126,28 +13154,28 @@ class Test_TC_CC_9_2 : public TestCommandBridge { err = TestReadColorLoopStartEnhancedHueAttributeFromDut_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Color Loop Set Command - Set all Attributes\n"); - if (ShouldSkip("CR_COLORLOOPSET")) { + ChipLogProgress(chipTool, " ***** Test Step 8 : Read EnhancedCurrentHue attribute from DUT.\n"); + if (ShouldSkip("A_ENHANCEDCURRENTHUE")) { NextTest(); return; } - err = TestColorLoopSetCommandSetAllAttributes_8(); + err = TestReadEnhancedCurrentHueAttributeFromDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read ColorLoopActive attribute from DUT.\n"); - if (ShouldSkip("A_COLORLOOPACTIVE")) { + ChipLogProgress(chipTool, " ***** Test Step 9 : Color Loop Set Command - Set all Attributes\n"); + if (ShouldSkip("CR_COLORLOOPSET")) { NextTest(); return; } - err = TestReadColorLoopActiveAttributeFromDut_9(); + err = TestColorLoopSetCommandSetAllAttributes_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Read EnhancedCurrentHue attribute from DUT.\n"); - if (ShouldSkip("A_ENHANCEDCURRENTHUE")) { + ChipLogProgress(chipTool, " ***** Test Step 10 : Read ColorLoopActive attribute from DUT.\n"); + if (ShouldSkip("A_COLORLOOPACTIVE")) { NextTest(); return; } - err = TestReadEnhancedCurrentHueAttributeFromDut_10(); + err = TestReadColorLoopActiveAttributeFromDut_10(); break; case 11: ChipLogProgress(chipTool, " ***** Test Step 11 : Read ColorLoopStoredEnhancedHue attribute from DUT.\n"); @@ -13394,8 +13422,31 @@ class Test_TC_CC_9_2 : public TestCommandBridge { return CHIP_NO_ERROR; } + NSNumber * _Nonnull EnhancedCurrentHueValue; - CHIP_ERROR TestColorLoopSetCommandSetAllAttributes_8() + CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read EnhancedCurrentHue attribute from DUT. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + { + EnhancedCurrentHueValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestColorLoopSetCommandSetAllAttributes_9() { CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -13421,7 +13472,7 @@ class Test_TC_CC_9_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_9() + CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_10() { CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -13442,29 +13493,6 @@ class Test_TC_CC_9_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull EnhancedCurrentHueValue; - - CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_10() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read EnhancedCurrentHue attribute from DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); - { - EnhancedCurrentHueValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_11() { @@ -21384,6 +21412,7 @@ class Test_TC_MC_9_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); VerifyOrReturn(CheckConstraintType("vendorName", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("vendorName", [value length], 32)); NextTest(); }]; @@ -21403,11 +21432,6 @@ class Test_TC_MC_9_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("VendorID", actualValue, 0U)); - } - VerifyOrReturn(CheckConstraintType("vendorID", "", "vendor-id")); NextTest(); }]; diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 767cce84c1d7fc..2ae2ddd5dc6181 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -5818,8 +5818,9 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_3(uint8_t currentHue) { - VerifyOrReturn(CheckValue("currentHue", currentHue, 0)); - + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("currentHue", currentHue, 0)); + VerifyOrReturn(CheckConstraintMaxValue("currentHue", currentHue, 254)); NextTest(); } @@ -5890,8 +5891,9 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_6(uint8_t currentSaturation) { - VerifyOrReturn(CheckValue("currentSaturation", currentSaturation, 0)); - + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", currentSaturation, 0)); + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", currentSaturation, 254)); NextTest(); } @@ -5962,8 +5964,9 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_9(uint16_t currentX) { - VerifyOrReturn(CheckValue("currentX", currentX, 24939U)); - + VerifyOrReturn(CheckConstraintType("currentX", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("currentX", currentX, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("currentX", currentX, 65279U)); NextTest(); } @@ -6034,8 +6037,9 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_12(uint16_t currentY) { - VerifyOrReturn(CheckValue("currentY", currentY, 24701U)); - + VerifyOrReturn(CheckConstraintType("currentY", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("currentY", currentY, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("currentY", currentY, 65279U)); NextTest(); } @@ -6223,8 +6227,7 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_20(uint16_t enhancedCurrentHue) { - VerifyOrReturn(CheckValue("enhancedCurrentHue", enhancedCurrentHue, 0U)); - + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); NextTest(); } @@ -6316,8 +6319,7 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_24(uint8_t colorLoopActive) { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); - + VerifyOrReturn(CheckConstraintType("colorLoopActive", "", "uint8")); NextTest(); } @@ -6386,8 +6388,7 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_27(uint8_t colorLoopDirection) { - VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 0)); - + VerifyOrReturn(CheckConstraintType("colorLoopDirection", "", "uint8")); NextTest(); } @@ -6456,8 +6457,7 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_30(uint16_t colorLoopTime) { - VerifyOrReturn(CheckValue("colorLoopTime", colorLoopTime, 25U)); - + VerifyOrReturn(CheckConstraintType("colorLoopTime", "", "uint16")); NextTest(); } @@ -6529,8 +6529,7 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_33(uint16_t colorLoopStartEnhancedHue) { - VerifyOrReturn(CheckValue("colorLoopStartEnhancedHue", colorLoopStartEnhancedHue, 8960U)); - + VerifyOrReturn(CheckConstraintType("colorLoopStartEnhancedHue", "", "uint16")); NextTest(); } @@ -6602,8 +6601,7 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_36(uint16_t colorLoopStoredEnhancedHue) { - VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", colorLoopStoredEnhancedHue, 0U)); - + VerifyOrReturn(CheckConstraintType("colorLoopStoredEnhancedHue", "", "uint16")); NextTest(); } @@ -6674,8 +6672,9 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_39(uint16_t colorCapabilities) { - VerifyOrReturn(CheckValue("colorCapabilities", colorCapabilities, 0U)); - + VerifyOrReturn(CheckConstraintType("colorCapabilities", "", "map16")); + VerifyOrReturn(CheckConstraintMinValue("colorCapabilities", colorCapabilities, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("colorCapabilities", colorCapabilities, 31U)); NextTest(); } @@ -6746,8 +6745,9 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_42(uint16_t colorTempPhysicalMin) { - VerifyOrReturn(CheckValue("colorTempPhysicalMin", colorTempPhysicalMin, 0U)); - + VerifyOrReturn(CheckConstraintType("colorTempPhysicalMin", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("colorTempPhysicalMin", colorTempPhysicalMin, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("colorTempPhysicalMin", colorTempPhysicalMin, 65279U)); NextTest(); } @@ -6818,8 +6818,9 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_45(uint16_t colorTempPhysicalMax) { - VerifyOrReturn(CheckValue("colorTempPhysicalMax", colorTempPhysicalMax, 65279U)); - + VerifyOrReturn(CheckConstraintType("colorTempPhysicalMax", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("colorTempPhysicalMax", colorTempPhysicalMax, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("colorTempPhysicalMax", colorTempPhysicalMax, 65279U)); NextTest(); } @@ -6898,8 +6899,7 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_48(uint16_t coupleColorTempToLevelMinMireds) { - VerifyOrReturn(CheckValue("coupleColorTempToLevelMinMireds", coupleColorTempToLevelMinMireds, 0U)); - + VerifyOrReturn(CheckConstraintType("coupleColorTempToLevelMinMireds", "", "uint16")); NextTest(); } @@ -7049,8 +7049,7 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_54(uint16_t remainingTime) { - VerifyOrReturn(CheckValue("remainingTime", remainingTime, 0U)); - + VerifyOrReturn(CheckConstraintType("remainingTime", "", "uint16")); NextTest(); } @@ -7128,8 +7127,9 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_57(uint8_t driftCompensation) { - VerifyOrReturn(CheckValue("driftCompensation", driftCompensation, 0)); - + VerifyOrReturn(CheckConstraintType("driftCompensation", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("driftCompensation", driftCompensation, 0)); + VerifyOrReturn(CheckConstraintMaxValue("driftCompensation", driftCompensation, 4)); NextTest(); } @@ -7206,8 +7206,8 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_60(chip::CharSpan compensationText) { - VerifyOrReturn(CheckValueAsString("compensationText", compensationText, chip::CharSpan("", 0))); - + VerifyOrReturn(CheckConstraintType("compensationText", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("compensationText", compensationText.size(), 254)); NextTest(); } @@ -7278,8 +7278,9 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_63(uint8_t numberOfPrimaries) { - VerifyOrReturn(CheckValue("numberOfPrimaries", numberOfPrimaries, 0)); - + VerifyOrReturn(CheckConstraintType("numberOfPrimaries", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("numberOfPrimaries", numberOfPrimaries, 0)); + VerifyOrReturn(CheckConstraintMaxValue("numberOfPrimaries", numberOfPrimaries, 6)); NextTest(); } @@ -7350,8 +7351,9 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_66(uint16_t primary1X) { - VerifyOrReturn(CheckValue("primary1X", primary1X, 0U)); - + VerifyOrReturn(CheckConstraintType("primary1X", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary1X", primary1X, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("primary1X", primary1X, 65279U)); NextTest(); } @@ -7422,8 +7424,9 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_69(uint16_t primary1Y) { - VerifyOrReturn(CheckValue("primary1Y", primary1Y, 0U)); - + VerifyOrReturn(CheckConstraintType("primary1Y", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary1Y", primary1Y, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("primary1Y", primary1Y, 65279U)); NextTest(); } @@ -7517,8 +7520,9 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_73(uint16_t primary2X) { - VerifyOrReturn(CheckValue("primary2X", primary2X, 0U)); - + VerifyOrReturn(CheckConstraintType("primary2X", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary2X", primary2X, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("primary2X", primary2X, 65279U)); NextTest(); } @@ -7589,8 +7593,9 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_76(uint16_t primary2Y) { - VerifyOrReturn(CheckValue("primary2Y", primary2Y, 0U)); - + VerifyOrReturn(CheckConstraintType("primary2Y", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary2Y", primary2Y, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("primary2Y", primary2Y, 65279U)); NextTest(); } @@ -7684,8 +7689,9 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_80(uint16_t primary3X) { - VerifyOrReturn(CheckValue("primary3X", primary3X, 0U)); - + VerifyOrReturn(CheckConstraintType("primary3X", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary3X", primary3X, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("primary3X", primary3X, 65279U)); NextTest(); } @@ -7756,8 +7762,9 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_83(uint16_t primary3Y) { - VerifyOrReturn(CheckValue("primary3Y", primary3Y, 0U)); - + VerifyOrReturn(CheckConstraintType("primary3Y", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary3Y", primary3Y, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("primary3Y", primary3Y, 65279U)); NextTest(); } @@ -7851,8 +7858,9 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_87(uint16_t primary4X) { - VerifyOrReturn(CheckValue("primary4X", primary4X, 0U)); - + VerifyOrReturn(CheckConstraintType("primary4X", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary4X", primary4X, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("primary4X", primary4X, 65279U)); NextTest(); } @@ -7923,8 +7931,9 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_90(uint16_t primary4Y) { - VerifyOrReturn(CheckValue("primary4Y", primary4Y, 0U)); - + VerifyOrReturn(CheckConstraintType("primary4Y", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary4Y", primary4Y, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("primary4Y", primary4Y, 65279U)); NextTest(); } @@ -8018,8 +8027,9 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_94(uint16_t primary5X) { - VerifyOrReturn(CheckValue("primary5X", primary5X, 0U)); - + VerifyOrReturn(CheckConstraintType("primary5X", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary5X", primary5X, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("primary5X", primary5X, 65279U)); NextTest(); } @@ -8090,8 +8100,9 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_97(uint16_t primary5Y) { - VerifyOrReturn(CheckValue("primary5Y", primary5Y, 0U)); - + VerifyOrReturn(CheckConstraintType("primary5Y", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary5Y", primary5Y, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("primary5Y", primary5Y, 65279U)); NextTest(); } @@ -8185,8 +8196,9 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_101(uint16_t primary6X) { - VerifyOrReturn(CheckValue("primary6X", primary6X, 0U)); - + VerifyOrReturn(CheckConstraintType("primary6X", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary6X", primary6X, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("primary6X", primary6X, 65279U)); NextTest(); } @@ -8257,8 +8269,9 @@ class Test_TC_CC_2_1Suite : public TestCommand void OnSuccessResponse_104(uint16_t primary6Y) { - VerifyOrReturn(CheckValue("primary6Y", primary6Y, 0U)); - + VerifyOrReturn(CheckConstraintType("primary6Y", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("primary6Y", primary6Y, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("primary6Y", primary6Y, 65279U)); NextTest(); } @@ -17669,31 +17682,31 @@ class Test_TC_CC_9_2Suite : public TestCommand err = TestReadColorLoopStartEnhancedHueAttributeFromDut_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Color Loop Set Command - Set all Attributes\n"); - if (ShouldSkip("CR_COLORLOOPSET")) + ChipLogProgress(chipTool, " ***** Test Step 8 : Read EnhancedCurrentHue attribute from DUT.\n"); + if (ShouldSkip("A_ENHANCEDCURRENTHUE")) { NextTest(); return; } - err = TestColorLoopSetCommandSetAllAttributes_8(); + err = TestReadEnhancedCurrentHueAttributeFromDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read ColorLoopActive attribute from DUT.\n"); - if (ShouldSkip("A_COLORLOOPACTIVE")) + ChipLogProgress(chipTool, " ***** Test Step 9 : Color Loop Set Command - Set all Attributes\n"); + if (ShouldSkip("CR_COLORLOOPSET")) { NextTest(); return; } - err = TestReadColorLoopActiveAttributeFromDut_9(); + err = TestColorLoopSetCommandSetAllAttributes_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Read EnhancedCurrentHue attribute from DUT.\n"); - if (ShouldSkip("A_ENHANCEDCURRENTHUE")) + ChipLogProgress(chipTool, " ***** Test Step 10 : Read ColorLoopActive attribute from DUT.\n"); + if (ShouldSkip("A_COLORLOOPACTIVE")) { NextTest(); return; } - err = TestReadEnhancedCurrentHueAttributeFromDut_10(); + err = TestReadColorLoopActiveAttributeFromDut_10(); break; case 11: ChipLogProgress(chipTool, " ***** Test Step 11 : Read ColorLoopStoredEnhancedHue attribute from DUT.\n"); @@ -17850,14 +17863,14 @@ class Test_TC_CC_9_2Suite : public TestCommand (static_cast(context))->OnSuccessResponse_7(colorLoopStartEnhancedHue); } - static void OnFailureCallback_9(void * context, CHIP_ERROR error) + static void OnFailureCallback_8(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_9(error); + (static_cast(context))->OnFailureResponse_8(error); } - static void OnSuccessCallback_9(void * context, uint8_t colorLoopActive) + static void OnSuccessCallback_8(void * context, uint16_t enhancedCurrentHue) { - (static_cast(context))->OnSuccessResponse_9(colorLoopActive); + (static_cast(context))->OnSuccessResponse_8(enhancedCurrentHue); } static void OnFailureCallback_10(void * context, CHIP_ERROR error) @@ -17865,9 +17878,9 @@ class Test_TC_CC_9_2Suite : public TestCommand (static_cast(context))->OnFailureResponse_10(error); } - static void OnSuccessCallback_10(void * context, uint16_t enhancedCurrentHue) + static void OnSuccessCallback_10(void * context, uint8_t colorLoopActive) { - (static_cast(context))->OnSuccessResponse_10(enhancedCurrentHue); + (static_cast(context))->OnSuccessResponse_10(colorLoopActive); } static void OnFailureCallback_11(void * context, CHIP_ERROR error) @@ -18122,7 +18135,31 @@ class Test_TC_CC_9_2Suite : public TestCommand NextTest(); } - CHIP_ERROR TestColorLoopSetCommandSetAllAttributes_8() + CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_8() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_8, OnFailureCallback_8, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_8(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_8(uint16_t enhancedCurrentHue) + { + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + EnhancedCurrentHueValue = enhancedCurrentHue; + NextTest(); + } + + CHIP_ERROR TestColorLoopSetCommandSetAllAttributes_9() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; @@ -18137,56 +18174,32 @@ class Test_TC_CC_9_2Suite : public TestCommand request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_8(); + (static_cast(context))->OnSuccessResponse_9(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_8(error); + (static_cast(context))->OnFailureResponse_9(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_8(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_8() { NextTest(); } - - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_9() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9, true)); - return CHIP_NO_ERROR; - } - void OnFailureResponse_9(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_9(uint8_t colorLoopActive) - { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 1)); - - NextTest(); - } + void OnSuccessResponse_9() { NextTest(); } - CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_10() + CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_10() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( + ReturnErrorOnFailure(cluster.ReadAttribute( this, OnSuccessCallback_10, OnFailureCallback_10, true)); return CHIP_NO_ERROR; } @@ -18197,10 +18210,10 @@ class Test_TC_CC_9_2Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_10(uint16_t enhancedCurrentHue) + void OnSuccessResponse_10(uint8_t colorLoopActive) { - VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); - EnhancedCurrentHueValue = enhancedCurrentHue; + VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 1)); + NextTest(); } @@ -31101,6 +31114,7 @@ class Test_TC_MC_9_1Suite : public TestCommand void OnSuccessResponse_2(chip::CharSpan vendorName) { VerifyOrReturn(CheckConstraintType("vendorName", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("vendorName", vendorName.size(), 32)); NextTest(); } @@ -31123,7 +31137,6 @@ class Test_TC_MC_9_1Suite : public TestCommand void OnSuccessResponse_3(uint16_t vendorID) { - VerifyOrReturn(CheckValue("vendorID", vendorID, 0U)); VerifyOrReturn(CheckConstraintType("vendorID", "", "vendor-id")); NextTest(); }