aboutsummaryrefslogtreecommitdiff
path: root/tests/qapi-schema
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-03-23 10:40:22 +0100
committerMarkus Armbruster <armbru@redhat.com>2021-03-23 22:31:31 +0100
commite75d4225b76842ec899f25e8ff39b070119f033f (patch)
tree92f99d87c6f4ea0ae843dfd508f82ef3dab5a099 /tests/qapi-schema
parent05ebf841efac494d8bd1f6d74642c3e9a3df4c19 (diff)
tests/qapi-schema: Switch member name clash test to struct
Test args-name-clash covers command parameter name clash. This effectively covers struct member name clash as well. The next commit will make parameter name clash impossible. Convert args-name-clash from testing command to testing a struct, and rename it to struct-member-name-clash. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20210323094025.3569441-26-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Commit message typo fixed]
Diffstat (limited to 'tests/qapi-schema')
-rw-r--r--tests/qapi-schema/args-name-clash.err2
-rw-r--r--tests/qapi-schema/meson.build2
-rw-r--r--tests/qapi-schema/struct-member-name-clash.err2
-rw-r--r--tests/qapi-schema/struct-member-name-clash.json (renamed from tests/qapi-schema/args-name-clash.json)2
-rw-r--r--tests/qapi-schema/struct-member-name-clash.out (renamed from tests/qapi-schema/args-name-clash.out)0
5 files changed, 4 insertions, 4 deletions
diff --git a/tests/qapi-schema/args-name-clash.err b/tests/qapi-schema/args-name-clash.err
deleted file mode 100644
index 3e04817bc0..0000000000
--- a/tests/qapi-schema/args-name-clash.err
+++ /dev/null
@@ -1,2 +0,0 @@
-args-name-clash.json: In command 'oops':
-args-name-clash.json:4: parameter 'a_b' collides with parameter 'a-b'
diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build
index 4e7635f0a8..8ba6917132 100644
--- a/tests/qapi-schema/meson.build
+++ b/tests/qapi-schema/meson.build
@@ -30,7 +30,6 @@ schemas = [
'args-member-array-bad.json',
'args-member-case.json',
'args-member-unknown.json',
- 'args-name-clash.json',
'args-union.json',
'args-unknown.json',
'bad-base.json',
@@ -177,6 +176,7 @@ schemas = [
'struct-member-if-invalid.json',
'struct-member-invalid-dict.json',
'struct-member-invalid.json',
+ 'struct-member-name-clash.json',
'trailing-comma-list.json',
'trailing-comma-object.json',
'type-bypass-bad-gen.json',
diff --git a/tests/qapi-schema/struct-member-name-clash.err b/tests/qapi-schema/struct-member-name-clash.err
new file mode 100644
index 0000000000..6ac042d59d
--- /dev/null
+++ b/tests/qapi-schema/struct-member-name-clash.err
@@ -0,0 +1,2 @@
+struct-member-name-clash.json: In struct 'Oops':
+struct-member-name-clash.json:4: member 'a_b' collides with member 'a-b'
diff --git a/tests/qapi-schema/args-name-clash.json b/tests/qapi-schema/struct-member-name-clash.json
index 61423cb893..3fb69cc2ce 100644
--- a/tests/qapi-schema/args-name-clash.json
+++ b/tests/qapi-schema/struct-member-name-clash.json
@@ -1,4 +1,4 @@
# C member name collision
# Reject members that clash when mapped to C names (we would have two 'a_b'
# members).
-{ 'command': 'oops', 'data': { 'a-b': 'str', 'a_b': 'str' } }
+{ 'struct': 'Oops', 'data': { 'a-b': 'str', 'a_b': 'str' } }
diff --git a/tests/qapi-schema/args-name-clash.out b/tests/qapi-schema/struct-member-name-clash.out
index e69de29bb2..e69de29bb2 100644
--- a/tests/qapi-schema/args-name-clash.out
+++ b/tests/qapi-schema/struct-member-name-clash.out