Skip to content

Commit

Permalink
Fix TC_SWDIAG_3_1.yaml test case on Linux (#15215)
Browse files Browse the repository at this point in the history
* Fix TC_SWDIAG_3_1.yaml test case on Linux

- The test case previously expected used/free heap value of 0.
- Now the SDK is implementing heap read properly from Linux when
  built with glibc. This made the code return a real value
  that fails the test.
- Overall, there is no "value" value for heap, we just need
  a value. The explicit value was replaced with expecting
  a returned value back.

* Restyled by whitespace

* Restyled by shfmt

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Jan 10, 2024
1 parent 7d51164 commit 1468108
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 16 deletions.
26 changes: 26 additions & 0 deletions scripts/tools/zap_regen_yaml_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
#
#
# Copyright (c) 2022 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.
#

#
# Description:
# Run this from root of SDK to regenerate only the ZAP needed by chip-tool,
# rather than all of zap like `./scripts/tools/zap_regen_all.py
#

./scripts/tools/zap/generate.py src/controller/data_model/controller-clusters.zap \
-o zzz_generated/chip-tool/zap-generated -t examples/chip-tool/templates/templates.json
6 changes: 4 additions & 2 deletions src/app/tests/suites/certification/Test_TC_SWDIAG_3_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ tests:
attribute: "CurrentHeapUsed"
PICS: A_CURRENTHEAPUSED
response:
value: 0
constraints:
type: uint64

- label: "Reads CurrentHeapHighWaterMark attribute value from DUT"
optional: true
command: "readAttribute"
attribute: "CurrentHeapHighWatermark"
PICS: A_CURRENTHEAPHIGHWATERMARK
response:
value: 0
constraints:
type: uint64
10 changes: 0 additions & 10 deletions src/darwin/Framework/CHIPTests/CHIPClustersTests.m

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

6 changes: 2 additions & 4 deletions zzz_generated/chip-tool/zap-generated/test/Commands.h

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

0 comments on commit 1468108

Please sign in to comment.