Skip to content

Commit 1001596

Browse files
bzbarsky-applepull[bot]
authored andcommitted
Fix handling of list-typed attributes in Darwin tests. (#12538)
Two issues here: 1) asTestValue did not handle list attributes properly: it assigned @(0) to the NSArray*. 2) This compiled, because we were not enabling -Werror for the build of the test harness. This fixes both issues. No codegen changes, because we don't actually have any non-excluded writable list-typed attributes yet. Which is good, because they would not have passed CI due to crashing when we try to treat an NSNumber* as NSArray*.
1 parent 35c54c9 commit 1001596

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.github/workflows/darwin.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
run: |
115115
mkdir -p /tmp/darwin/framework-tests
116116
../../../out/debug/chip-all-clusters-app > >(tee /tmp/darwin/framework-tests/all-cluster-app.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-err.log >&2) &
117-
xcodebuild test -target "CHIP" -scheme "CHIP Framework Tests" -sdk macosx > >(tee /tmp/darwin/framework-tests/darwin-tests.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-err.log >&2)
117+
xcodebuild test -target "CHIP" -scheme "CHIP Framework Tests" -sdk macosx OTHER_CFLAGS='${inherited} -Werror -Wno-documentation -Wno-conditional-uninitialized -Wno-incomplete-umbrella' > >(tee /tmp/darwin/framework-tests/darwin-tests.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-err.log >&2)
118118
working-directory: src/darwin/Framework
119119
- name: Uploading log files
120120
uses: actions/upload-artifact@v2

src/darwin/Framework/CHIP/templates/helper.js

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ function asTestValue()
5656
return '[@"Test" dataUsingEncoding:NSUTF8StringEncoding]';
5757
} else if (StringHelper.isCharString(this.type)) {
5858
return '@"Test"';
59+
} else if (this.isArray) {
60+
return '[NSArray array]';
5961
} else {
6062
return `@(${this.min || this.max || 0})`;
6163
}

0 commit comments

Comments
 (0)