Skip to content

Commit

Permalink
Adding BooleanState Yaml test cases and update (#11517)
Browse files Browse the repository at this point in the history
* Adding BooleanState Yaml test cases and update
generated tests

* Restyled by prettier-yaml

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Feb 11, 2022
1 parent b548fc2 commit 1358912
Show file tree
Hide file tree
Showing 6 changed files with 568 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/chip-tool/templates/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ function getTests()
'Test_TC_BI_2_1',
];

const BooleanState = [
'Test_TC_BOOL_1_1',
'Test_TC_BOOL_2_1',
];

const ColorControl = [
'Test_TC_CC_1_1',
'Test_TC_CC_2_1',
Expand Down Expand Up @@ -182,6 +187,7 @@ function getTests()

const tests = [
BinaryInput, //
BooleanState, //
ColorControl, //
DeviceManagement, //
ElectricalMeasurement, //
Expand Down
42 changes: 42 additions & 0 deletions src/app/tests/suites/certification/Test_TC_BOOL_1_1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright (c) 2021 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 60.1.1. [TC-BOOL-1.1] Global attributes with server as DUT

config:
cluster: "Boolean State"
endpoint: 1

tests:
- label: "read the global attribute: ClusterRevision"
command: "readAttribute"
attribute: "ClusterRevision"
response:
value: 1

- label:
"write the default values to mandatory global attribute:
ClusterRevision"
command: "writeAttribute"
attribute: "ClusterRevision"
arguments:
value: 1
response:
error: 1

- label: "reads back global attribute: ClusterRevision"
command: "readAttribute"
attribute: "ClusterRevision"
response:
value: 1
48 changes: 48 additions & 0 deletions src/app/tests/suites/certification/Test_TC_BOOL_2_1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright (c) 2021 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 60.2.1. [TC-BOOL-2.1] Attributes with server as DUT

config:
cluster: "Boolean State"
endpoint: 1

tests:
- label: "Read mandatory non-global attribute: StateValue"
command: "readAttribute"
attribute: "StateValue"
response:
value: 0

- label: "Read mandatory non-global attribute constraints: StateValue"
command: "readAttribute"
attribute: "StateValue"
response:
constraints:
type: bool

- label:
"Write the default value to mandatory non-global attribute: StateValue"
command: "writeAttribute"
attribute: "StateValue"
arguments:
value: 1
response:
error: 1

- label: "Reads back the mandatory non-global attribute: StateValue"
command: "readAttribute"
attribute: "StateValue"
response:
value: 0
6 changes: 6 additions & 0 deletions src/darwin/Framework/CHIP/templates/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ function getTests()
'Test_TC_BI_2_1',
];

const BooleanState = [
'Test_TC_BOOL_1_1',
'Test_TC_BOOL_2_1',
];

const ColorControl = [
'Test_TC_CC_1_1',
'Test_TC_CC_2_1',
Expand Down Expand Up @@ -166,6 +171,7 @@ function getTests()

const tests = [
BinaryInput, //
BooleanState, //
ColorControl, //
DeviceManagement, //
ElectricalMeasurement, //
Expand Down
150 changes: 150 additions & 0 deletions src/darwin/Framework/CHIPTests/CHIPClustersTests.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1358912

Please sign in to comment.