Skip to content

Commit

Permalink
Resolve optional attribute with response (#16321)
Browse files Browse the repository at this point in the history
* Handle optional attribute and response error write.

* Generated Code.
  • Loading branch information
krypton36 authored and pull[bot] committed Feb 15, 2024
1 parent 3acadc9 commit ccac2bb
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 16 deletions.
9 changes: 9 additions & 0 deletions examples/chip-tool/templates/tests/partials/test_cluster.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,17 @@ class {{filename}}Suite: public TestCommand
{
chip::app::StatusIB status(error);
{{#if response.error}}
{{#if optional}}
if (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute){
{{#unless async}}NextTest();{{/unless}}
} else {
VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), {{response.error}}));
{{#unless async}}NextTest();{{/unless}}
}
{{else}}
VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), {{response.error}}));
{{#unless async}}NextTest();{{/unless}}
{{/if}}
{{else}}
{{#if optional}}(status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : {{/if}}ThrowFailureResponse();
{{/if}}
Expand Down
88 changes: 72 additions & 16 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 ccac2bb

Please sign in to comment.