Skip to content

Commit 1151028

Browse files
vivien-applepull[bot]
authored andcommitted
[TestConstraints] Add some tests for the hasValue constraints (#25087)
* [TestConstraints] Add some tests for the hasValue constraints * Update generated tests content
1 parent 29b6efd commit 1151028

File tree

3 files changed

+571
-2
lines changed

3 files changed

+571
-2
lines changed

src/app/tests/suites/TestConstraints.yaml

+78
Original file line numberDiff line numberDiff line change
@@ -265,3 +265,81 @@ tests:
265265
attribute: "char_string"
266266
arguments:
267267
value: ""
268+
269+
# Tests for hasValue attribute
270+
271+
- label: "Read attribute NULLABLE_INT8U Default Value"
272+
command: "readAttribute"
273+
attribute: "nullable_int8u"
274+
response:
275+
value: 0
276+
277+
- label: "Write attribute NULLABLE_INT8U with a value"
278+
command: "writeAttribute"
279+
attribute: "nullable_int8u"
280+
arguments:
281+
value: 0
282+
283+
- label: "Read attribute NULLABLE_INT8U with a value"
284+
command: "readAttribute"
285+
attribute: "nullable_int8u"
286+
response:
287+
constraints:
288+
hasValue: true
289+
290+
- label: "Write attribute NULLABLE_INT8U without a value"
291+
command: "writeAttribute"
292+
attribute: "nullable_int8u"
293+
arguments:
294+
value: null
295+
296+
- label: "Read attribute NULLABLE_INT8U with a value"
297+
command: "readAttribute"
298+
attribute: "nullable_int8u"
299+
response:
300+
constraints:
301+
hasValue: false
302+
303+
- label: "Write attribute NULLABLE_INT8U back to Default Value"
304+
command: "writeAttribute"
305+
attribute: "nullable_int8u"
306+
arguments:
307+
value: 0
308+
309+
- label: "Read attribute NULLABLE_OCTET_STRING Default Value"
310+
command: "readAttribute"
311+
attribute: "nullable_octet_string"
312+
response:
313+
value: ""
314+
315+
- label: "Write attribute NULLABLE_OCTET_STRING"
316+
command: "writeAttribute"
317+
attribute: "nullable_octet_string"
318+
arguments:
319+
value: "TestValue"
320+
321+
- label: "Read attribute NULLABLE_OCTET_STRING"
322+
command: "readAttribute"
323+
attribute: "nullable_octet_string"
324+
response:
325+
constraints:
326+
hasValue: true
327+
328+
- label: "Write attribute NULLABLE_OCTET_STRING"
329+
command: "writeAttribute"
330+
attribute: "nullable_octet_string"
331+
arguments:
332+
value: null
333+
334+
- label: "Read attribute NULLABLE_OCTET_STRING"
335+
command: "readAttribute"
336+
attribute: "nullable_octet_string"
337+
response:
338+
constraints:
339+
hasValue: false
340+
341+
- label: "Write attribute NULLABLE_OCTET_STRING back to Default Value"
342+
command: "writeAttribute"
343+
attribute: "nullable_octet_string"
344+
arguments:
345+
value: ""

zzz_generated/chip-tool/zap-generated/test/Commands.h

+148-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)