Skip to content

Commit

Permalink
Enable more TestCluster tests. (#13057)
Browse files Browse the repository at this point in the history
Minor tweak to Darwin templates make them use the right suffixes on
literals to make this compile.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Nov 15, 2023
1 parent 00e3eba commit 2419824
Show file tree
Hide file tree
Showing 4 changed files with 2,530 additions and 1,936 deletions.
142 changes: 70 additions & 72 deletions src/app/tests/suites/TestCluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2011,42 +2011,41 @@ tests:
response:
value: null

# TODO: TestCluster INT64 Darwin fix err integer literal is too large to be represented in a signed integer type
#- label: "Read attribute NULLABLE_INT64U null Value & range"
# command: "readAttribute"
# attribute: "nullable_int64u"
# response:
# constraints:
# minValue: 0
# maxValue: "18446744073709551614"

#- label: "Read attribute NULLABLE_INT64U null Value & not"
# command: "readAttribute"
# attribute: "nullable_int64u"
# response:
# constraints:
# notValue: "18446744073709551614"

#- label: "Write attribute NULLABLE_INT64U Value"
# command: "writeAttribute"
# attribute: "nullable_int64u"
# arguments:
# value: "18000000000000000000"

#- label: "Read attribute NULLABLE_INT64U Value in range"
# command: "readAttribute"
# attribute: "nullable_int64u"
# response:
# constraints:
# minValue: 0
# maxValue: "18446744073709551614"

#- label: "Read attribute NULLABLE_INT64U notValue OK"
# command: "readAttribute"
# attribute: "nullable_int64u"
# response:
# constraints:
# notValue: "18000000000000000001"
- label: "Read attribute NULLABLE_INT64U null Value & range"
command: "readAttribute"
attribute: "nullable_int64u"
response:
constraints:
minValue: 0
maxValue: "18446744073709551614"

- label: "Read attribute NULLABLE_INT64U null Value & not"
command: "readAttribute"
attribute: "nullable_int64u"
response:
constraints:
notValue: "18446744073709551614"

- label: "Write attribute NULLABLE_INT64U Value"
command: "writeAttribute"
attribute: "nullable_int64u"
arguments:
value: "18000000000000000000"

- label: "Read attribute NULLABLE_INT64U Value in range"
command: "readAttribute"
attribute: "nullable_int64u"
response:
constraints:
minValue: 0
maxValue: "18446744073709551614"

- label: "Read attribute NULLABLE_INT64U notValue OK"
command: "readAttribute"
attribute: "nullable_int64u"
response:
constraints:
notValue: "18000000000000000001"

# Tests for nullable Int8 attribute

Expand Down Expand Up @@ -2319,42 +2318,41 @@ tests:
response:
value: null

# TODO: TestCluster INT64 Darwin fix err integer literal is too large to be represented in a signed integer type
#- label: "Read attribute NULLABLE_INT64S null Value & range"
# command: "readAttribute"
# attribute: "nullable_int64s"
# response:
# constraints:
# minValue: "-9223372036854775807"
# maxValue: "9223372036854775807"

#- label: "Read attribute NULLABLE_INT64S null Value & not"
# command: "readAttribute"
# attribute: "nullable_int64s"
# response:
# constraints:
# notValue: "-9223372036854775807"

#- label: "Write attribute NULLABLE_INT64S Value"
# command: "writeAttribute"
# attribute: "nullable_int64s"
# arguments:
# value: "-9223372036854775807"

#- label: "Read attribute NULLABLE_INT64S Value in range"
# command: "readAttribute"
# attribute: "nullable_int64s"
# response:
# constraints:
# minValue: "-9223372036854775807"
# maxValue: "9223372036854775807"

#- label: "Read attribute NULLABLE_INT64S notValue OK"
# command: "readAttribute"
# attribute: "nullable_int64s"
# response:
# constraints:
# notValue: "-9223372036854775806"
- label: "Read attribute NULLABLE_INT64S null Value & range"
command: "readAttribute"
attribute: "nullable_int64s"
response:
constraints:
minValue: "-9223372036854775807"
maxValue: "9223372036854775807"

- label: "Read attribute NULLABLE_INT64S null Value & not"
command: "readAttribute"
attribute: "nullable_int64s"
response:
constraints:
notValue: "-9223372036854775807"

- label: "Write attribute NULLABLE_INT64S Value"
command: "writeAttribute"
attribute: "nullable_int64s"
arguments:
value: "-9223372036854775807"

- label: "Read attribute NULLABLE_INT64S Value in range"
command: "readAttribute"
attribute: "nullable_int64s"
response:
constraints:
minValue: "-9223372036854775807"
maxValue: "9223372036854775807"

- label: "Read attribute NULLABLE_INT64S notValue OK"
command: "readAttribute"
attribute: "nullable_int64s"
response:
constraints:
notValue: "-9223372036854775806"

# Tests for float attribute

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,23 +136,23 @@ ResponseHandler {{> subscribeDataCallback}} = nil;
{
{{> actualValue}}
if (actualValue != nil) {
XCTAssertGreaterThanOrEqual([actualValue {{asObjectiveCNumberType "" type true}}Value], {{expectedConstraints.minValue}});
XCTAssertGreaterThanOrEqual([actualValue {{asObjectiveCNumberType "" type true}}Value], {{asTypedLiteral expectedConstraints.minValue type}});
}
}
{{/if}}
{{#if expectedConstraints.maxValue}}
{
{{> actualValue}}
if (actualValue != nil) {
XCTAssertLessThanOrEqual([actualValue {{asObjectiveCNumberType "" type true}}Value], {{expectedConstraints.maxValue}});
XCTAssertLessThanOrEqual([actualValue {{asObjectiveCNumberType "" type true}}Value], {{asTypedLiteral expectedConstraints.maxValue type}});
}
}
{{/if}}
{{#if expectedConstraints.notValue}}
{
{{> actualValue}}
if (actualValue != nil) {
XCTAssertNotEqual([actualValue {{asObjectiveCNumberType "" type true}}Value], {{expectedConstraints.notValue}});
XCTAssertNotEqual([actualValue {{asObjectiveCNumberType "" type true}}Value], {{asTypedLiteral expectedConstraints.notValue type}});
}
}
{{/if}}
Expand Down
Loading

0 comments on commit 2419824

Please sign in to comment.