Skip to content

Commit

Permalink
Remove expectedValueHasProp now that we have a generic hasProperty he…
Browse files Browse the repository at this point in the history
…lper. (#13512)
  • Loading branch information
bzbarsky-apple authored Jan 13, 2022
1 parent 6bb25d5 commit 60347b6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
type/optionality/nullability information for them for our recursive
call. }}
{{#zcl_struct_items_by_struct_name type}}
{{#if (expectedValueHasProp ../expected label)}}
{{#if (hasProperty ../expected label)}}
{{>valueEquals label=(concat ../label "." (asLowerCamelCase label)) actual=(concat ../actual "." (asLowerCamelCase label)) expected=(lookup ../expected label) depth=(incrementDepth depth)}}
{{/if}}
{{/zcl_struct_items_by_struct_name}}
Expand Down
6 changes: 0 additions & 6 deletions src/app/zap-templates/common/ClusterTestGeneration.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,11 +645,6 @@ function isLiteralNull(value, options)
return (value === null) || (value instanceof NullObject);
}

function expectedValueHasProp(value, name)
{
return name in value;
}

function octetStringEscapedForCLiteral(value)
{
// Escape control characters, things outside the ASCII range, and single
Expand Down Expand Up @@ -693,6 +688,5 @@ exports.chip_tests_config_get_default_value = chip_tests_config_get_default_valu
exports.chip_tests_config_get_type = chip_tests_config_get_type;
exports.isTestOnlyCluster = isTestOnlyCluster;
exports.isLiteralNull = isLiteralNull;
exports.expectedValueHasProp = expectedValueHasProp;
exports.octetStringEscapedForCLiteral = octetStringEscapedForCLiteral;
exports.if_include_struct_item_value = if_include_struct_item_value;
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
type/optionality/nullability information for them for our recursive
call. }}
{{#zcl_struct_items_by_struct_name type}}
{{#if (expectedValueHasProp ../expected label)}}
{{#if (hasProperty ../expected label)}}
{{>check_test_value actual=(concat "((CHIP" (asUpperCamelCase ../cluster) "Cluster" (asUpperCamelCase ../type) " *)" ../actual ")." (asStructPropertyName label)) expected=(lookup ../expected label) cluster=../cluster}}
{{/if}}
{{/zcl_struct_items_by_struct_name}}
Expand Down

0 comments on commit 60347b6

Please sign in to comment.