Skip to content

Commit

Permalink
DEV: Add constraint checks on nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
jmeg-sfy committed Dec 14, 2021
1 parent 929e68e commit 233fb01
Show file tree
Hide file tree
Showing 2 changed files with 3,708 additions and 2,091 deletions.
301 changes: 295 additions & 6 deletions src/app/tests/suites/TestCluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,7 @@ tests:
response:
value: null

# Tests for UInt8 attribute
# Tests for nullable UInt8 attribute

- label: "Write attribute NULLABLE_INT8U Max Value"
command: "writeAttribute"
Expand Down Expand Up @@ -1783,7 +1783,43 @@ tests:
response:
value: null

# Tests for UInt16 attribute
- label: "Read attribute NULLABLE_INT8U null Value & range"
command: "readAttribute"
attribute: "nullable_int8u"
response:
constraints:
minValue: 0
maxValue: 254

- label: "Read attribute NULLABLE_INT8U null Value & not"
command: "readAttribute"
attribute: "nullable_int8u"
response:
constraints:
notValue: 254

- label: "Write attribute NULLABLE_INT8U Value"
command: "writeAttribute"
attribute: "nullable_int8u"
arguments:
value: 128

- label: "Read attribute NULLABLE_INT8U Value in range"
command: "readAttribute"
attribute: "nullable_int8u"
response:
constraints:
minValue: 0
maxValue: 254

- label: "Read attribute NULLABLE_INT8U notValue OK"
command: "readAttribute"
attribute: "nullable_int8u"
response:
constraints:
notValue: 129

# Tests for nullable UInt16 attribute

- label: "Write attribute NULLABLE_INT16U Max Value"
command: "writeAttribute"
Expand Down Expand Up @@ -1823,7 +1859,43 @@ tests:
response:
value: null

# Tests for UInt32 attribute
- label: "Read attribute NULLABLE_INT16U null Value & range"
command: "readAttribute"
attribute: "nullable_int16u"
response:
constraints:
minValue: 0
maxValue: 65534

- label: "Read attribute NULLABLE_INT16U null Value & not"
command: "readAttribute"
attribute: "nullable_int16u"
response:
constraints:
notValue: 65534

- label: "Write attribute NULLABLE_INT16U Value"
command: "writeAttribute"
attribute: "nullable_int16u"
arguments:
value: 32000

- label: "Read attribute NULLABLE_INT16U Value in range"
command: "readAttribute"
attribute: "nullable_int16u"
response:
constraints:
minValue: 0
maxValue: 65534

- label: "Read attribute NULLABLE_INT16U notValue OK"
command: "readAttribute"
attribute: "nullable_int16u"
response:
constraints:
notValue: 32001

# Tests for nullable UInt32 attribute

- label: "Write attribute NULLABLE_INT32U Max Value"
command: "writeAttribute"
Expand Down Expand Up @@ -1863,7 +1935,43 @@ tests:
response:
value: null

# Tests for UInt64 attribute
- label: "Read attribute NULLABLE_INT32U null Value & range"
command: "readAttribute"
attribute: "nullable_int32u"
response:
constraints:
minValue: 0
maxValue: 4294967294

- label: "Read attribute NULLABLE_INT32U null Value & not"
command: "readAttribute"
attribute: "nullable_int32u"
response:
constraints:
notValue: 4294967294

- label: "Write attribute NULLABLE_INT32U Value"
command: "writeAttribute"
attribute: "nullable_int32u"
arguments:
value: 2147483647

- label: "Read attribute NULLABLE_INT32U Value in range"
command: "readAttribute"
attribute: "nullable_int32u"
response:
constraints:
minValue: 0
maxValue: 4294967294

- label: "Read attribute NULLABLE_INT32U notValue OK"
command: "readAttribute"
attribute: "nullable_int32u"
response:
constraints:
notValue: 2147483648

# Tests for nullable UInt64 attribute

- label: "Write attribute NULLABLE_INT64U Max Value"
command: "writeAttribute"
Expand Down Expand Up @@ -1903,7 +2011,43 @@ tests:
response:
value: null

# Tests for Int8 attribute
- 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

- label: "Write attribute NULLABLE_INT8S Min Value"
command: "writeAttribute"
Expand Down Expand Up @@ -1943,7 +2087,43 @@ tests:
response:
value: null

# Tests for Int16 attribute
- label: "Read attribute NULLABLE_INT8S null Value & range"
command: "readAttribute"
attribute: "nullable_int8s"
response:
constraints:
minValue: -127
maxValue: 127

- label: "Read attribute NULLABLE_INT8S null Value & not"
command: "readAttribute"
attribute: "nullable_int8s"
response:
constraints:
notValue: -127

- label: "Write attribute NULLABLE_INT8S Value"
command: "writeAttribute"
attribute: "nullable_int8s"
arguments:
value: -127

- label: "Read attribute NULLABLE_INT8S Value in range"
command: "readAttribute"
attribute: "nullable_int8s"
response:
constraints:
minValue: -127
maxValue: 127

- label: "Read attribute NULLABLE_INT8S notValue OK"
command: "readAttribute"
attribute: "nullable_int8s"
response:
constraints:
notValue: -126

# Tests for nullable Int16 attribute

- label: "Write attribute NULLABLE_INT16S Min Value"
command: "writeAttribute"
Expand Down Expand Up @@ -1983,6 +2163,42 @@ tests:
response:
value: null

- label: "Read attribute NULLABLE_INT16S null Value & range"
command: "readAttribute"
attribute: "nullable_int16s"
response:
constraints:
minValue: -32767
maxValue: 32767

- label: "Read attribute NULLABLE_INT16S null Value & not"
command: "readAttribute"
attribute: "nullable_int16s"
response:
constraints:
notValue: -32767

- label: "Write attribute NULLABLE_INT16S Value"
command: "writeAttribute"
attribute: "nullable_int16s"
arguments:
value: -32767

- label: "Read attribute NULLABLE_INT16S Value in range"
command: "readAttribute"
attribute: "nullable_int16s"
response:
constraints:
minValue: -32767
maxValue: 32767

- label: "Read attribute NULLABLE_INT16S notValue OK"
command: "readAttribute"
attribute: "nullable_int16s"
response:
constraints:
notValue: -32766

# Tests for Int32 attribute

- label: "Write attribute NULLABLE_INT32S Min Value"
Expand Down Expand Up @@ -2023,6 +2239,42 @@ tests:
response:
value: null

- label: "Read attribute NULLABLE_INT32S null Value & range"
command: "readAttribute"
attribute: "nullable_int32s"
response:
constraints:
minValue: -2147483647
maxValue: 2147483647

- label: "Read attribute NULLABLE_INT32S null Value & not"
command: "readAttribute"
attribute: "nullable_int32s"
response:
constraints:
notValue: -2147483647

- label: "Write attribute NULLABLE_INT32S Value"
command: "writeAttribute"
attribute: "nullable_int32s"
arguments:
value: -2147483647

- label: "Read attribute NULLABLE_INT32S Value in range"
command: "readAttribute"
attribute: "nullable_int32s"
response:
constraints:
minValue: -2147483647
maxValue: 2147483647

- label: "Read attribute NULLABLE_INT32S notValue OK"
command: "readAttribute"
attribute: "nullable_int32s"
response:
constraints:
notValue: -2147483646

# Tests for Int64 attribute

- label: "Write attribute NULLABLE_INT64S Min Value"
Expand Down Expand Up @@ -2066,6 +2318,43 @@ tests:
response:
value: null

- 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

- label: "Write attribute NULLABLE_SINGLE medium Value"
Expand Down
Loading

0 comments on commit 233fb01

Please sign in to comment.