Skip to content

Commit

Permalink
Add unit test for event field type checking.
Browse files Browse the repository at this point in the history
  • Loading branch information
tecimovic committed Jun 29, 2022
1 parent f0de62e commit 330521a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"lintfix": "eslint --fix --ext .js,.vue src src-electron src-shared src-script test",
"electron-build-dmg": "node src-script/build-dmg.js",
"clean:report": "rm -rf .nyc_output || true",
"tsc": "tsc --build ./tsconfig.json",
"test": " npm run test:unit && npm run test:e2e-ci && npm run report",
"test:unit": "node src-script/zap-versionstamp.js && jest --reporters=jest-junit --reporters=default --updateSnapshot",
"test:unit:verbose": "jest --updateSnapshot --verbose false",
Expand Down
8 changes: 8 additions & 0 deletions test/gen-template/matter/events.zapt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
List of all events.

{{#zcl_events}}
>> Event: {{name}}
{{#zcl_event_fields}}
> Field: {{name}} {{#if_is_enum type}}[ENUM]{{/if_is_enum}}{{#if_is_bitmap type}}[BITMAP]{{/if_is_bitmap}}
{{/zcl_event_fields}}
{{/zcl_events}}
5 changes: 5 additions & 0 deletions test/gen-template/matter/gen-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
"path": "endpoint-config.zapt",
"name": "Endpoint Configuration",
"output": "endpoint-config.c"
},
{
"path": "events.zapt",
"name": "Events",
"output": "events.out"
}
]
}
2 changes: 1 addition & 1 deletion test/test-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ exports.testTemplate = {
zigbee: './test/gen-template/zigbee/gen-templates.json',
zigbeeCount: 27,
matter: './test/gen-template/matter/gen-test.json',
matterCount: 5,
matterCount: 6,
dotdot: './test/gen-template/dotdot/dotdot-templates.json',
dotdotCount: 5,
unittest: './test/gen-template/test/gen-test.json',
Expand Down
2 changes: 1 addition & 1 deletion zcl-builtin/matter/test-cluster.xml
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ limitations under the License.
<field id="1" name="arg1" type="INT8U"/>
<field id="2" name="arg2" type="SimpleEnum"/>
<field id="3" name="arg3" type="BOOLEAN"/>
<field id="4" name="arg4" type="SimpleStruct"/>
<field id="4" name="arg4" type="SimpleBitmap"/>
<field id="5" name="arg5" type="SimpleStruct" array="true"/>
<field id="6" name="arg6" type="SimpleEnum" array="true"/>
</event>
Expand Down

0 comments on commit 330521a

Please sign in to comment.