From 886f93151c223b75d084bba8d31433833e7eda06 Mon Sep 17 00:00:00 2001 From: LUCAS BECKER Date: Sat, 20 Jan 2024 15:27:44 -0300 Subject: [PATCH] Update commands --- .../zap-generated/test/Commands.h | 124 ++---------------- 1 file changed, 10 insertions(+), 114 deletions(-) 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 b7f991447427f6..5d8a7988aca387 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -185,7 +185,7 @@ class TestList : public Command { printf("Test_TC_OPSTATE_1_1\n"); printf("Test_TC_OVENOPSTATE_1_1\n"); printf("Test_TC_OVENOPSTATE_2_2\n"); - printf("Test_TC_OVENOPSTATE_2_4\n"); + printf("Test_TC_OVENOPSTATE_2_5\n"); printf("Test_TC_PS_1_1\n"); printf("Test_TC_PS_2_1\n"); printf("Test_TC_PRS_1_1\n"); @@ -90461,11 +90461,11 @@ class Test_TC_OVENOPSTATE_2_2 : public TestCommandBridge { } }; -class Test_TC_OVENOPSTATE_2_4 : public TestCommandBridge { +class Test_TC_OVENOPSTATE_2_5 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_OVENOPSTATE_2_4() - : TestCommandBridge("Test_TC_OVENOPSTATE_2_4") + Test_TC_OVENOPSTATE_2_5() + : TestCommandBridge("Test_TC_OVENOPSTATE_2_5") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -90475,7 +90475,7 @@ class Test_TC_OVENOPSTATE_2_4 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_OVENOPSTATE_2_4() + ~Test_TC_OVENOPSTATE_2_5() { } @@ -90485,11 +90485,11 @@ class Test_TC_OVENOPSTATE_2_4 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OVENOPSTATE_2_4\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OVENOPSTATE_2_5\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OVENOPSTATE_2_4\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OVENOPSTATE_2_5\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -90501,34 +90501,6 @@ class Test_TC_OVENOPSTATE_2_4 : public TestCommandBridge { // but before our function call returns, we won't end up with an // incorrect mTestIndex value observed when we get the response. switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Step 1: Commission DUT to TH\n"); - err = TestStep1CommissionDutToTh_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: Set up a subscription to the OperationalError event\n"); - if (ShouldSkip("OVENOPSTATE.S.E00")) { - NextTest(); - return; - } - err = TestStep2SetUpASubscriptionToTheOperationalErrorEvent_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: At the DUT take the vendor defined action to generate an OperationalError event\n"); - if (ShouldSkip("OVENOPSTATE.S.E00 && PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestStep3AtTheDutTakeTheVendorDefinedActionToGenerateAnOperationalErrorEvent_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step 4: TH reads from the DUT the OperationalState attribute\n"); - if (ShouldSkip("OVENOPSTATE.S.A0004 && PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestStep4ThReadsFromTheDutTheOperationalStateAttribute_3(); - break; } if (CHIP_NO_ERROR != err) { @@ -90540,17 +90512,6 @@ class Test_TC_OVENOPSTATE_2_4 : public TestCommandBridge { void OnStatusUpdate(const chip::app::StatusIB & status) override { switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -90561,78 +90522,13 @@ class Test_TC_OVENOPSTATE_2_4 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 0; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; chip::Optional mTimeout; - - CHIP_ERROR TestStep1CommissionDutToTh_0() - { - - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestStep2SetUpASubscriptionToTheOperationalErrorEvent_1() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOvenCavityOperationalState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - if (err != nil) { - NSLog(@"Step 2: Set up a subscription to the OperationalError event: Error: %@", err); - } else { - NSLog(@"Step 2: Set up a subscription to the OperationalError event: Success"); - } - }]; - - return CHIP_NO_ERROR; -} - -CHIP_ERROR -TestStep3AtTheDutTakeTheVendorDefinedActionToGenerateAnOperationalErrorEvent_2() -{ - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); -} - -CHIP_ERROR TestStep4ThReadsFromTheDutTheOperationalStateAttribute_3() -{ - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOvenCavityOperationalState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOperationalStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - if (err != nil) { - NSLog(@"Step 4: TH reads from the DUT the OperationalState attribute: Error: %@", err); - } else { - NSLog(@"Step 4: TH reads from the DUT the OperationalState attribute: Success"); - } - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("OperationalState", actualValue, 3U)); - } - - VerifyOrReturn(CheckConstraintType("operationalState", "enum8", "enum8")); - NextTest(); - }]; - - return CHIP_NO_ERROR; -} -} -; +}; class Test_TC_PS_1_1 : public TestCommandBridge { public: @@ -194006,7 +193902,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), - make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(),