From ccbc16c12075daf4fed54689e203426da8d5b4c3 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Mon, 2 May 2022 16:03:16 +0200 Subject: [PATCH] Update generated Window Covering tests --- .../zap-generated/test/Commands.h | 67 ++++--------------- .../chip-tool/zap-generated/test/Commands.h | 32 ++------- 2 files changed, 19 insertions(+), 80 deletions(-) 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 b33933c3a5c8a1..e7b955f9eb2d54 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h @@ -59917,36 +59917,28 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { err = Test1aIfPaLfLfThReadsCurrentPositionLiftPercent100thsFromDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : 1b: If (PA_LF & LF) TH reads CurrentPositionLiftPercentage from DUT\n"); - if (ShouldSkip("WNCV_LF && WNCV_PA_LF && A_CURRENTPOSITIONLIFTPERCENTAGE")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : 2b: TH sends GoToLiftPercentage command with BadParam to DUT\n"); + if (ShouldSkip("WNCV_LF && WNCV_PA_LF || WNCV_LF && CR_GOTOLIFTPERCENTAGE")) { NextTest(); return; } - err = Test1bIfPaLfLfThReadsCurrentPositionLiftPercentageFromDut_2(); + err = Test2bThSendsGoToLiftPercentageCommandWithBadParamToDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : 2b: TH sends GoToLiftPercentage command with BadParam to DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 3 : 3a: TH sends GoToLiftPercentage command with 10001 to DUT\n"); if (ShouldSkip("WNCV_LF && WNCV_PA_LF || WNCV_LF && CR_GOTOLIFTPERCENTAGE")) { NextTest(); return; } - err = Test2bThSendsGoToLiftPercentageCommandWithBadParamToDut_3(); + err = Test3aThSendsGoToLiftPercentageCommandWith10001ToDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : 3a: TH sends GoToLiftPercentage command with 10001 to DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 4 : 4a: TH sends GoToLiftPercentage command with 0xFFFF to DUT\n"); if (ShouldSkip("WNCV_LF && WNCV_PA_LF || WNCV_LF && CR_GOTOLIFTPERCENTAGE")) { NextTest(); return; } - err = Test3aThSendsGoToLiftPercentageCommandWith10001ToDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : 4a: TH sends GoToLiftPercentage command with 0xFFFF to DUT\n"); - if (ShouldSkip("WNCV_LF && WNCV_PA_LF || WNCV_LF && CR_GOTOLIFTPERCENTAGE")) { - NextTest(); - return; - } - err = Test4aThSendsGoToLiftPercentageCommandWith0xFFFFToDut_5(); + err = Test4aThSendsGoToLiftPercentageCommandWith0xFFFFToDut_4(); break; } @@ -59966,7 +59958,7 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); @@ -59974,9 +59966,6 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - break; } // Go on to the next test. @@ -59990,7 +59979,7 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 5; chip::Optional mNodeId; chip::Optional mCluster; @@ -60035,40 +60024,8 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nullable attrCurrentPositionLiftPercentage; - - CHIP_ERROR Test1bIfPaLfLfThReadsCurrentPositionLiftPercentageFromDut_2() - { - SetIdentity("alpha"); - CHIPDevice * device = GetConnectedDevice(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster - readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"1b: If (PA_LF & LF) TH reads CurrentPositionLiftPercentage from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - if (value != nil) { - VerifyOrReturn( - CheckConstraintMinValue("currentPositionLiftPercentage", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn( - CheckConstraintMaxValue("currentPositionLiftPercentage", [value unsignedCharValue], 100)); - } - { - attrCurrentPositionLiftPercentage = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - CHIP_ERROR Test2bThSendsGoToLiftPercentageCommandWithBadParamToDut_3() + CHIP_ERROR Test2bThSendsGoToLiftPercentageCommandWithBadParamToDut_2() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -60089,7 +60046,7 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test3aThSendsGoToLiftPercentageCommandWith10001ToDut_4() + CHIP_ERROR Test3aThSendsGoToLiftPercentageCommandWith10001ToDut_3() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -60110,7 +60067,7 @@ class Test_TC_WNCV_4_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR Test4aThSendsGoToLiftPercentageCommandWith0xFFFFToDut_5() + CHIP_ERROR Test4aThSendsGoToLiftPercentageCommandWith0xFFFFToDut_4() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 2ac682e1afed01..7fe7b35bca2159 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -31528,7 +31528,7 @@ class Test_TC_WNCV_4_2Suite : public TestCommand class Test_TC_WNCV_4_3Suite : public TestCommand { public: - Test_TC_WNCV_4_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_4_3", 6, credsIssuerConfig) + Test_TC_WNCV_4_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_4_3", 5, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -31550,7 +31550,6 @@ class Test_TC_WNCV_4_3Suite : public TestCommand chip::Optional mTimeout; chip::app::DataModel::Nullable attrCurrentPositionLiftPercent100ths; - chip::app::DataModel::Nullable attrCurrentPositionLiftPercentage; chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } @@ -31579,14 +31578,7 @@ class Test_TC_WNCV_4_3Suite : public TestCommand } break; case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::DataModel::Nullable value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 100)); - attrCurrentPositionLiftPercentage = value; - } + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); @@ -31594,9 +31586,6 @@ class Test_TC_WNCV_4_3Suite : public TestCommand case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -31624,14 +31613,7 @@ class Test_TC_WNCV_4_3Suite : public TestCommand WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id); } case 2: { - LogStep(2, "1b: If (PA_LF & LF) TH reads CurrentPositionLiftPercentage from DUT"); - VerifyOrdo(!ShouldSkip("WNCV_LF && WNCV_PA_LF && A_CURRENTPOSITIONLIFTPERCENTAGE"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, - WindowCovering::Attributes::CurrentPositionLiftPercentage::Id); - } - case 3: { - LogStep(3, "2b: TH sends GoToLiftPercentage command with BadParam to DUT"); + LogStep(2, "2b: TH sends GoToLiftPercentage command with BadParam to DUT"); VerifyOrdo(!ShouldSkip("WNCV_LF && WNCV_PA_LF || WNCV_LF && CR_GOTOLIFTPERCENTAGE"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); chip::app::Clusters::WindowCovering::Commands::GoToLiftPercentage::Type value; @@ -31641,8 +31623,8 @@ class Test_TC_WNCV_4_3Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::GoToLiftPercentage::Id, value); } - case 4: { - LogStep(4, "3a: TH sends GoToLiftPercentage command with 10001 to DUT"); + case 3: { + LogStep(3, "3a: TH sends GoToLiftPercentage command with 10001 to DUT"); VerifyOrdo(!ShouldSkip("WNCV_LF && WNCV_PA_LF || WNCV_LF && CR_GOTOLIFTPERCENTAGE"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); chip::app::Clusters::WindowCovering::Commands::GoToLiftPercentage::Type value; @@ -31652,8 +31634,8 @@ class Test_TC_WNCV_4_3Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Commands::GoToLiftPercentage::Id, value); } - case 5: { - LogStep(5, "4a: TH sends GoToLiftPercentage command with 0xFFFF to DUT"); + case 4: { + LogStep(4, "4a: TH sends GoToLiftPercentage command with 0xFFFF to DUT"); VerifyOrdo(!ShouldSkip("WNCV_LF && WNCV_PA_LF || WNCV_LF && CR_GOTOLIFTPERCENTAGE"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); chip::app::Clusters::WindowCovering::Commands::GoToLiftPercentage::Type value;