[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 12/14] tests/qapi-schema: Cover optional conditional struct membe
From: |
Markus Armbruster |
Subject: |
[PATCH 12/14] tests/qapi-schema: Cover optional conditional struct member |
Date: |
Thu, 16 Mar 2023 08:13:23 +0100 |
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
tests/qapi-schema/qapi-schema-test.json | 3 ++-
tests/qapi-schema/qapi-schema-test.out | 2 ++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/tests/qapi-schema/qapi-schema-test.json
b/tests/qapi-schema/qapi-schema-test.json
index 8f0ee95d23..f1f742d38c 100644
--- a/tests/qapi-schema/qapi-schema-test.json
+++ b/tests/qapi-schema/qapi-schema-test.json
@@ -220,7 +220,8 @@
{ 'struct': 'TestIfStruct',
'data': { 'foo': 'int',
- 'bar': { 'type': 'int', 'if': 'TEST_IF_STRUCT_MEMBER'} },
+ 'bar': { 'type': 'int', 'if': 'TEST_IF_STRUCT_MEMBER'},
+ '*baz': { 'type': 'str', 'if': 'TEST_IF_STRUCT_MEMBER'} },
'if': 'TEST_IF_STRUCT' }
{ 'enum': 'TestIfEnum',
diff --git a/tests/qapi-schema/qapi-schema-test.out
b/tests/qapi-schema/qapi-schema-test.out
index 715f3a3f23..cee92c0d2e 100644
--- a/tests/qapi-schema/qapi-schema-test.out
+++ b/tests/qapi-schema/qapi-schema-test.out
@@ -247,6 +247,8 @@ object TestIfStruct
member foo: int optional=False
member bar: int optional=False
if TEST_IF_STRUCT_MEMBER
+ member baz: str optional=True
+ if TEST_IF_STRUCT_MEMBER
if TEST_IF_STRUCT
enum TestIfEnum
member foo
--
2.39.2
- Re: [PATCH 11/14] tests/qapi-schema: Clean up positive test for conditionals, (continued)
- [PATCH 05/14] qapi: Improve error message for unexpected array types, Markus Armbruster, 2023/03/16
- [PATCH 02/14] qapi/schema: Use super(), Markus Armbruster, 2023/03/16
- [PATCH 01/14] qapi: Fix error message format regression, Markus Armbruster, 2023/03/16
- [PATCH 08/14] qapi: Fix to reject 'data': 'mumble' in struct, Markus Armbruster, 2023/03/16
- [PATCH 12/14] tests/qapi-schema: Cover optional conditional struct member,
Markus Armbruster <=
- [PATCH 14/14] qapi: Require boxed for conditional command and event arguments, Markus Armbruster, 2023/03/16
- [PATCH 04/14] qapi: Split up check_type(), Markus Armbruster, 2023/03/16
- [PATCH 03/14] qapi: Clean up after removal of simple unions, Markus Armbruster, 2023/03/16
- [PATCH 06/14] qapi: Simplify code a bit after previous commit, Markus Armbruster, 2023/03/16