From 51680195b5c72676ce251fbcc26727ced3357841 Mon Sep 17 00:00:00 2001 From: Matt Hazley <hello@matthazley.com> Date: Mon, 8 Jan 2024 18:48:40 +0100 Subject: [PATCH] Add Uncertainty Check to all 2.1 Concentration Measurement Tests (#31290) * Fixes #31263 by adding uncertainty check to all concentration tests * Regen after test change * Restyled by whitespace --------- Co-authored-by: Restyled.io <commits@restyled.io> --- .../certification/Test_TC_CDOCONC_2_1.yaml | 9 + .../certification/Test_TC_CMOCONC_2_1.yaml | 9 + .../certification/Test_TC_FLDCONC_2_1.yaml | 9 + .../certification/Test_TC_NDOCONC_2_1.yaml | 9 + .../certification/Test_TC_OZCONC_2_1.yaml | 9 + .../certification/Test_TC_PMHCONC_2_1.yaml | 9 + .../certification/Test_TC_PMICONC_2_1.yaml | 9 + .../certification/Test_TC_PMKCONC_2_1.yaml | 9 + .../certification/Test_TC_RNCONC_2_1.yaml | 9 + .../certification/Test_TC_TVOCCONC_2_1.yaml | 9 + .../zap-generated/test/Commands.h | 380 +++++++++++++++++- 11 files changed, 460 insertions(+), 10 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_CDOCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_CDOCONC_2_1.yaml index aefd4aeb36e961..dd3ba305b602bc 100644 --- a/src/app/tests/suites/certification/Test_TC_CDOCONC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CDOCONC_2_1.yaml @@ -133,3 +133,12 @@ tests: type: enum8 minValue: 0 maxValue: 4 + + - label: "Step 12: TH reads from the DUT the Uncertainty attribute." + PICS: CDOCONC.S.A0007 + command: "readAttribute" + attribute: "Uncertainty" + response: + constraints: + type: single + minValue: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CMOCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_CMOCONC_2_1.yaml index 9d1ab7f333031e..88fd3646e6b1e0 100644 --- a/src/app/tests/suites/certification/Test_TC_CMOCONC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CMOCONC_2_1.yaml @@ -133,3 +133,12 @@ tests: type: enum8 minValue: 0 maxValue: 4 + + - label: "Step 12: TH reads from the DUT the Uncertainty attribute." + PICS: CMOCONC.S.A0007 + command: "readAttribute" + attribute: "Uncertainty" + response: + constraints: + type: single + minValue: 0 diff --git a/src/app/tests/suites/certification/Test_TC_FLDCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_FLDCONC_2_1.yaml index fa75195dd33fff..3a9ca77e47a334 100644 --- a/src/app/tests/suites/certification/Test_TC_FLDCONC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_FLDCONC_2_1.yaml @@ -133,3 +133,12 @@ tests: type: enum8 minValue: 0 maxValue: 4 + + - label: "Step 12: TH reads from the DUT the Uncertainty attribute." + PICS: FLDCONC.S.A0007 + command: "readAttribute" + attribute: "Uncertainty" + response: + constraints: + type: single + minValue: 0 diff --git a/src/app/tests/suites/certification/Test_TC_NDOCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_NDOCONC_2_1.yaml index 145610ca5ff950..e795b775716df8 100644 --- a/src/app/tests/suites/certification/Test_TC_NDOCONC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_NDOCONC_2_1.yaml @@ -133,3 +133,12 @@ tests: type: enum8 minValue: 0 maxValue: 4 + + - label: "Step 12: TH reads from the DUT the Uncertainty attribute." + PICS: NDOCONC.S.A0007 + command: "readAttribute" + attribute: "Uncertainty" + response: + constraints: + type: single + minValue: 0 diff --git a/src/app/tests/suites/certification/Test_TC_OZCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_OZCONC_2_1.yaml index d1cf7f692e555a..96223f37b386f5 100644 --- a/src/app/tests/suites/certification/Test_TC_OZCONC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OZCONC_2_1.yaml @@ -133,3 +133,12 @@ tests: type: enum8 minValue: 0 maxValue: 4 + + - label: "Step 12: TH reads from the DUT the Uncertainty attribute." + PICS: OZCONC.S.A0007 + command: "readAttribute" + attribute: "Uncertainty" + response: + constraints: + type: single + minValue: 0 diff --git a/src/app/tests/suites/certification/Test_TC_PMHCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_PMHCONC_2_1.yaml index 2e673e96a6899c..4f3d0c36559a45 100644 --- a/src/app/tests/suites/certification/Test_TC_PMHCONC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_PMHCONC_2_1.yaml @@ -133,3 +133,12 @@ tests: type: enum8 minValue: 0 maxValue: 4 + + - label: "Step 12: TH reads from the DUT the Uncertainty attribute." + PICS: PMHCONC.S.A0007 + command: "readAttribute" + attribute: "Uncertainty" + response: + constraints: + type: single + minValue: 0 diff --git a/src/app/tests/suites/certification/Test_TC_PMICONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_PMICONC_2_1.yaml index f1692efb0443e2..ea0252acda3aee 100644 --- a/src/app/tests/suites/certification/Test_TC_PMICONC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_PMICONC_2_1.yaml @@ -133,3 +133,12 @@ tests: type: enum8 minValue: 0 maxValue: 4 + + - label: "Step 12: TH reads from the DUT the Uncertainty attribute." + PICS: PMICONC.S.A0007 + command: "readAttribute" + attribute: "Uncertainty" + response: + constraints: + type: single + minValue: 0 diff --git a/src/app/tests/suites/certification/Test_TC_PMKCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_PMKCONC_2_1.yaml index 1045a64fada66c..26d68f04f51954 100644 --- a/src/app/tests/suites/certification/Test_TC_PMKCONC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_PMKCONC_2_1.yaml @@ -133,3 +133,12 @@ tests: type: enum8 minValue: 0 maxValue: 4 + + - label: "Step 12: TH reads from the DUT the Uncertainty attribute." + PICS: PMKCONC.S.A0007 + command: "readAttribute" + attribute: "Uncertainty" + response: + constraints: + type: single + minValue: 0 diff --git a/src/app/tests/suites/certification/Test_TC_RNCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_RNCONC_2_1.yaml index fe2a4adebcfae9..dffcf2e7b39818 100644 --- a/src/app/tests/suites/certification/Test_TC_RNCONC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_RNCONC_2_1.yaml @@ -133,3 +133,12 @@ tests: type: enum8 minValue: 0 maxValue: 4 + + - label: "Step 12: TH reads from the DUT the Uncertainty attribute." + PICS: RNCONC.S.A0007 + command: "readAttribute" + attribute: "Uncertainty" + response: + constraints: + type: single + minValue: 0 diff --git a/src/app/tests/suites/certification/Test_TC_TVOCCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_TVOCCONC_2_1.yaml index 578b12c8de855d..a63ecaecfabe5a 100644 --- a/src/app/tests/suites/certification/Test_TC_TVOCCONC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TVOCCONC_2_1.yaml @@ -133,3 +133,12 @@ tests: type: enum8 minValue: 0 maxValue: 4 + + - label: "Step 12: TH reads from the DUT the Uncertainty attribute." + PICS: TVOCCONC.S.A0007 + command: "readAttribute" + attribute: "Uncertainty" + response: + constraints: + type: single + minValue: 0 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 5a739fd0e02d9f..73c0b07b89b670 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -30012,6 +30012,14 @@ class Test_TC_CDOCONC_2_1 : public TestCommandBridge { } err = TestStep11ThReadsFromTheDutTheLevelValueAttribute_10(); break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 12: TH reads from the DUT the Uncertainty attribute.\n"); + if (ShouldSkip("CDOCONC.S.A0007")) { + NextTest(); + return; + } + err = TestStep12ThReadsFromTheDutTheUncertaintyAttribute_11(); + break; } if (CHIP_NO_ERROR != err) { @@ -30056,6 +30064,9 @@ class Test_TC_CDOCONC_2_1 : public TestCommandBridge { case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -30066,7 +30077,7 @@ class Test_TC_CDOCONC_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 11; + const uint16_t mTestCount = 12; chip::Optional<chip::NodeId> mNodeId; chip::Optional<chip::CharSpan> mCluster; @@ -30361,6 +30372,31 @@ class Test_TC_CDOCONC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestStep12ThReadsFromTheDutTheUncertaintyAttribute_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 12: TH reads from the DUT the Uncertainty attribute.: Error: %@", err); + } else { + NSLog(@"Step 12: TH reads from the DUT the Uncertainty attribute.: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("uncertainty", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue<float>("uncertainty", [value floatValue], 0.0f)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_CMOCONC_1_1 : public TestCommandBridge { @@ -31579,6 +31615,14 @@ class Test_TC_CMOCONC_2_1 : public TestCommandBridge { } err = TestStep11ThReadsFromTheDutTheLevelValueAttribute_10(); break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 12: TH reads from the DUT the Uncertainty attribute.\n"); + if (ShouldSkip("CMOCONC.S.A0007")) { + NextTest(); + return; + } + err = TestStep12ThReadsFromTheDutTheUncertaintyAttribute_11(); + break; } if (CHIP_NO_ERROR != err) { @@ -31623,6 +31667,9 @@ class Test_TC_CMOCONC_2_1 : public TestCommandBridge { case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -31633,7 +31680,7 @@ class Test_TC_CMOCONC_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 11; + const uint16_t mTestCount = 12; chip::Optional<chip::NodeId> mNodeId; chip::Optional<chip::CharSpan> mCluster; @@ -31928,6 +31975,31 @@ class Test_TC_CMOCONC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestStep12ThReadsFromTheDutTheUncertaintyAttribute_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 12: TH reads from the DUT the Uncertainty attribute.: Error: %@", err); + } else { + NSLog(@"Step 12: TH reads from the DUT the Uncertainty attribute.: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("uncertainty", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue<float>("uncertainty", [value floatValue], 0.0f)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_FLDCONC_1_1 : public TestCommandBridge { @@ -33146,6 +33218,14 @@ class Test_TC_FLDCONC_2_1 : public TestCommandBridge { } err = TestStep11ThReadsFromTheDutTheLevelValueAttribute_10(); break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 12: TH reads from the DUT the Uncertainty attribute.\n"); + if (ShouldSkip("FLDCONC.S.A0007")) { + NextTest(); + return; + } + err = TestStep12ThReadsFromTheDutTheUncertaintyAttribute_11(); + break; } if (CHIP_NO_ERROR != err) { @@ -33190,6 +33270,9 @@ class Test_TC_FLDCONC_2_1 : public TestCommandBridge { case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -33200,7 +33283,7 @@ class Test_TC_FLDCONC_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 11; + const uint16_t mTestCount = 12; chip::Optional<chip::NodeId> mNodeId; chip::Optional<chip::CharSpan> mCluster; @@ -33495,6 +33578,31 @@ class Test_TC_FLDCONC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestStep12ThReadsFromTheDutTheUncertaintyAttribute_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 12: TH reads from the DUT the Uncertainty attribute.: Error: %@", err); + } else { + NSLog(@"Step 12: TH reads from the DUT the Uncertainty attribute.: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("uncertainty", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue<float>("uncertainty", [value floatValue], 0.0f)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_NDOCONC_1_1 : public TestCommandBridge { @@ -34713,6 +34821,14 @@ class Test_TC_NDOCONC_2_1 : public TestCommandBridge { } err = TestStep11ThReadsFromTheDutTheLevelValueAttribute_10(); break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 12: TH reads from the DUT the Uncertainty attribute.\n"); + if (ShouldSkip("NDOCONC.S.A0007")) { + NextTest(); + return; + } + err = TestStep12ThReadsFromTheDutTheUncertaintyAttribute_11(); + break; } if (CHIP_NO_ERROR != err) { @@ -34757,6 +34873,9 @@ class Test_TC_NDOCONC_2_1 : public TestCommandBridge { case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -34767,7 +34886,7 @@ class Test_TC_NDOCONC_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 11; + const uint16_t mTestCount = 12; chip::Optional<chip::NodeId> mNodeId; chip::Optional<chip::CharSpan> mCluster; @@ -35062,6 +35181,31 @@ class Test_TC_NDOCONC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestStep12ThReadsFromTheDutTheUncertaintyAttribute_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 12: TH reads from the DUT the Uncertainty attribute.: Error: %@", err); + } else { + NSLog(@"Step 12: TH reads from the DUT the Uncertainty attribute.: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("uncertainty", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue<float>("uncertainty", [value floatValue], 0.0f)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_OZCONC_1_1 : public TestCommandBridge { @@ -36280,6 +36424,14 @@ class Test_TC_OZCONC_2_1 : public TestCommandBridge { } err = TestStep11ThReadsFromTheDutTheLevelValueAttribute_10(); break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 12: TH reads from the DUT the Uncertainty attribute.\n"); + if (ShouldSkip("OZCONC.S.A0007")) { + NextTest(); + return; + } + err = TestStep12ThReadsFromTheDutTheUncertaintyAttribute_11(); + break; } if (CHIP_NO_ERROR != err) { @@ -36324,6 +36476,9 @@ class Test_TC_OZCONC_2_1 : public TestCommandBridge { case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -36334,7 +36489,7 @@ class Test_TC_OZCONC_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 11; + const uint16_t mTestCount = 12; chip::Optional<chip::NodeId> mNodeId; chip::Optional<chip::CharSpan> mCluster; @@ -36629,6 +36784,31 @@ class Test_TC_OZCONC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestStep12ThReadsFromTheDutTheUncertaintyAttribute_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 12: TH reads from the DUT the Uncertainty attribute.: Error: %@", err); + } else { + NSLog(@"Step 12: TH reads from the DUT the Uncertainty attribute.: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("uncertainty", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue<float>("uncertainty", [value floatValue], 0.0f)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_PMHCONC_1_1 : public TestCommandBridge { @@ -37847,6 +38027,14 @@ class Test_TC_PMHCONC_2_1 : public TestCommandBridge { } err = TestStep11ThReadsFromTheDutTheLevelValueAttribute_10(); break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 12: TH reads from the DUT the Uncertainty attribute.\n"); + if (ShouldSkip("PMHCONC.S.A0007")) { + NextTest(); + return; + } + err = TestStep12ThReadsFromTheDutTheUncertaintyAttribute_11(); + break; } if (CHIP_NO_ERROR != err) { @@ -37891,6 +38079,9 @@ class Test_TC_PMHCONC_2_1 : public TestCommandBridge { case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -37901,7 +38092,7 @@ class Test_TC_PMHCONC_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 11; + const uint16_t mTestCount = 12; chip::Optional<chip::NodeId> mNodeId; chip::Optional<chip::CharSpan> mCluster; @@ -38196,6 +38387,31 @@ class Test_TC_PMHCONC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestStep12ThReadsFromTheDutTheUncertaintyAttribute_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 12: TH reads from the DUT the Uncertainty attribute.: Error: %@", err); + } else { + NSLog(@"Step 12: TH reads from the DUT the Uncertainty attribute.: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("uncertainty", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue<float>("uncertainty", [value floatValue], 0.0f)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_PMICONC_1_1 : public TestCommandBridge { @@ -39414,6 +39630,14 @@ class Test_TC_PMICONC_2_1 : public TestCommandBridge { } err = TestStep11ThReadsFromTheDutTheLevelValueAttribute_10(); break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 12: TH reads from the DUT the Uncertainty attribute.\n"); + if (ShouldSkip("PMICONC.S.A0007")) { + NextTest(); + return; + } + err = TestStep12ThReadsFromTheDutTheUncertaintyAttribute_11(); + break; } if (CHIP_NO_ERROR != err) { @@ -39458,6 +39682,9 @@ class Test_TC_PMICONC_2_1 : public TestCommandBridge { case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -39468,7 +39695,7 @@ class Test_TC_PMICONC_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 11; + const uint16_t mTestCount = 12; chip::Optional<chip::NodeId> mNodeId; chip::Optional<chip::CharSpan> mCluster; @@ -39763,6 +39990,31 @@ class Test_TC_PMICONC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestStep12ThReadsFromTheDutTheUncertaintyAttribute_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 12: TH reads from the DUT the Uncertainty attribute.: Error: %@", err); + } else { + NSLog(@"Step 12: TH reads from the DUT the Uncertainty attribute.: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("uncertainty", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue<float>("uncertainty", [value floatValue], 0.0f)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_PMKCONC_1_1 : public TestCommandBridge { @@ -40981,6 +41233,14 @@ class Test_TC_PMKCONC_2_1 : public TestCommandBridge { } err = TestStep11ThReadsFromTheDutTheLevelValueAttribute_10(); break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 12: TH reads from the DUT the Uncertainty attribute.\n"); + if (ShouldSkip("PMKCONC.S.A0007")) { + NextTest(); + return; + } + err = TestStep12ThReadsFromTheDutTheUncertaintyAttribute_11(); + break; } if (CHIP_NO_ERROR != err) { @@ -41025,6 +41285,9 @@ class Test_TC_PMKCONC_2_1 : public TestCommandBridge { case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -41035,7 +41298,7 @@ class Test_TC_PMKCONC_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 11; + const uint16_t mTestCount = 12; chip::Optional<chip::NodeId> mNodeId; chip::Optional<chip::CharSpan> mCluster; @@ -41330,6 +41593,31 @@ class Test_TC_PMKCONC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestStep12ThReadsFromTheDutTheUncertaintyAttribute_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 12: TH reads from the DUT the Uncertainty attribute.: Error: %@", err); + } else { + NSLog(@"Step 12: TH reads from the DUT the Uncertainty attribute.: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("uncertainty", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue<float>("uncertainty", [value floatValue], 0.0f)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_RNCONC_1_1 : public TestCommandBridge { @@ -42548,6 +42836,14 @@ class Test_TC_RNCONC_2_1 : public TestCommandBridge { } err = TestStep11ThReadsFromTheDutTheLevelValueAttribute_10(); break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 12: TH reads from the DUT the Uncertainty attribute.\n"); + if (ShouldSkip("RNCONC.S.A0007")) { + NextTest(); + return; + } + err = TestStep12ThReadsFromTheDutTheUncertaintyAttribute_11(); + break; } if (CHIP_NO_ERROR != err) { @@ -42592,6 +42888,9 @@ class Test_TC_RNCONC_2_1 : public TestCommandBridge { case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -42602,7 +42901,7 @@ class Test_TC_RNCONC_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 11; + const uint16_t mTestCount = 12; chip::Optional<chip::NodeId> mNodeId; chip::Optional<chip::CharSpan> mCluster; @@ -42897,6 +43196,31 @@ class Test_TC_RNCONC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestStep12ThReadsFromTheDutTheUncertaintyAttribute_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 12: TH reads from the DUT the Uncertainty attribute.: Error: %@", err); + } else { + NSLog(@"Step 12: TH reads from the DUT the Uncertainty attribute.: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("uncertainty", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue<float>("uncertainty", [value floatValue], 0.0f)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_TVOCCONC_1_1 : public TestCommandBridge { @@ -44115,6 +44439,14 @@ class Test_TC_TVOCCONC_2_1 : public TestCommandBridge { } err = TestStep11ThReadsFromTheDutTheLevelValueAttribute_10(); break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 12: TH reads from the DUT the Uncertainty attribute.\n"); + if (ShouldSkip("TVOCCONC.S.A0007")) { + NextTest(); + return; + } + err = TestStep12ThReadsFromTheDutTheUncertaintyAttribute_11(); + break; } if (CHIP_NO_ERROR != err) { @@ -44159,6 +44491,9 @@ class Test_TC_TVOCCONC_2_1 : public TestCommandBridge { case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -44169,7 +44504,7 @@ class Test_TC_TVOCCONC_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 11; + const uint16_t mTestCount = 12; chip::Optional<chip::NodeId> mNodeId; chip::Optional<chip::CharSpan> mCluster; @@ -44464,6 +44799,31 @@ class Test_TC_TVOCCONC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestStep12ThReadsFromTheDutTheUncertaintyAttribute_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 12: TH reads from the DUT the Uncertainty attribute.: Error: %@", err); + } else { + NSLog(@"Step 12: TH reads from the DUT the Uncertainty attribute.: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("uncertainty", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue<float>("uncertainty", [value floatValue], 0.0f)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_OPCREDS_1_2 : public TestCommandBridge {