[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 2/7] qapi-schema: test: add a qapi-schema-test for array alternate
From: |
Markus Armbruster |
Subject: |
[PULL 2/7] qapi-schema: test: add a qapi-schema-test for array alternates |
Date: |
Thu, 21 Apr 2022 16:31:30 +0200 |
From: Paolo Bonzini <pbonzini@redhat.com>
Check that conflicts among array alternates are detected correctly.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20220321164243.200569-3-pbonzini@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Expected test output alternate-conflict-lists.json corrected]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
tests/qapi-schema/alternate-conflict-lists.err | 2 ++
tests/qapi-schema/alternate-conflict-lists.json | 6 ++++++
tests/qapi-schema/alternate-conflict-lists.out | 0
tests/qapi-schema/meson.build | 1 +
4 files changed, 9 insertions(+)
create mode 100644 tests/qapi-schema/alternate-conflict-lists.err
create mode 100644 tests/qapi-schema/alternate-conflict-lists.json
create mode 100644 tests/qapi-schema/alternate-conflict-lists.out
diff --git a/tests/qapi-schema/alternate-conflict-lists.err
b/tests/qapi-schema/alternate-conflict-lists.err
new file mode 100644
index 0000000000..f3374ec1e7
--- /dev/null
+++ b/tests/qapi-schema/alternate-conflict-lists.err
@@ -0,0 +1,2 @@
+alternate-conflict-lists.json: In alternate 'Alt':
+alternate-conflict-lists.json:4: branch 'two' can't be distinguished from 'one'
diff --git a/tests/qapi-schema/alternate-conflict-lists.json
b/tests/qapi-schema/alternate-conflict-lists.json
new file mode 100644
index 0000000000..a3efd6c501
--- /dev/null
+++ b/tests/qapi-schema/alternate-conflict-lists.json
@@ -0,0 +1,6 @@
+# Two lists conflict even if their inner types would be compatible
+{ 'struct': 'One',
+ 'data': { 'name': 'str' } }
+{ 'alternate': 'Alt',
+ 'data': { 'one': [ 'int' ],
+ 'two': [ 'str' ] } }
diff --git a/tests/qapi-schema/alternate-conflict-lists.out
b/tests/qapi-schema/alternate-conflict-lists.out
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build
index caf0791ba8..c18dd7d02f 100644
--- a/tests/qapi-schema/meson.build
+++ b/tests/qapi-schema/meson.build
@@ -11,6 +11,7 @@ schemas = [
'alternate-conflict-dict.json',
'alternate-conflict-enum-bool.json',
'alternate-conflict-enum-int.json',
+ 'alternate-conflict-lists.json',
'alternate-conflict-string.json',
'alternate-conflict-bool-string.json',
'alternate-conflict-num-string.json',
--
2.35.1
- [PULL 0/7] QAPI patches patches for 2022-04-21, Markus Armbruster, 2022/04/21
- [PULL 3/7] qapi-schema: test: add a unit test for parsing array alternates, Markus Armbruster, 2022/04/21
- [PULL 7/7] qapi: Fix version of cpu0-id field, Markus Armbruster, 2022/04/21
- [PULL 2/7] qapi-schema: test: add a qapi-schema-test for array alternates,
Markus Armbruster <=
- [PULL 6/7] qapi: Fix typo, Markus Armbruster, 2022/04/21
- [PULL 4/7] docs: qapi: Remove outdated reference to simple unions, Markus Armbruster, 2022/04/21
- [PULL 5/7] qapi: Fix documentation for query-xen-replication-status, Markus Armbruster, 2022/04/21
- [PULL 1/7] qapi-schema: support alternates with array type, Markus Armbruster, 2022/04/21
- Re: [PULL 0/7] QAPI patches patches for 2022-04-21, Richard Henderson, 2022/04/21