]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
tests/qapi-schema: Switch member name clash test to struct
authorMarkus Armbruster <armbru@redhat.com>
Tue, 23 Mar 2021 09:40:22 +0000 (10:40 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 23 Mar 2021 21:31:31 +0000 (22:31 +0100)
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]

tests/qapi-schema/args-name-clash.err [deleted file]
tests/qapi-schema/args-name-clash.json [deleted file]
tests/qapi-schema/args-name-clash.out [deleted file]
tests/qapi-schema/meson.build
tests/qapi-schema/struct-member-name-clash.err [new file with mode: 0644]
tests/qapi-schema/struct-member-name-clash.json [new file with mode: 0644]
tests/qapi-schema/struct-member-name-clash.out [new file with mode: 0644]

diff --git a/tests/qapi-schema/args-name-clash.err b/tests/qapi-schema/args-name-clash.err
deleted file mode 100644 (file)
index 3e04817..0000000
+++ /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/args-name-clash.json b/tests/qapi-schema/args-name-clash.json
deleted file mode 100644 (file)
index 61423cb..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# 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' } }
diff --git a/tests/qapi-schema/args-name-clash.out b/tests/qapi-schema/args-name-clash.out
deleted file mode 100644 (file)
index e69de29..0000000
index 4e7635f0a80c93472e24becc15858b8767d2b2a4..8ba69171329b6d70afad27d6bcaaa3fada709931 100644 (file)
@@ -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 (file)
index 0000000..6ac042d
--- /dev/null
@@ -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/struct-member-name-clash.json b/tests/qapi-schema/struct-member-name-clash.json
new file mode 100644 (file)
index 0000000..3fb69cc
--- /dev/null
@@ -0,0 +1,4 @@
+# C member name collision
+# Reject members that clash when mapped to C names (we would have two 'a_b'
+# members).
+{ 'struct': 'Oops', 'data': { 'a-b': 'str', 'a_b': 'str' } }
diff --git a/tests/qapi-schema/struct-member-name-clash.out b/tests/qapi-schema/struct-member-name-clash.out
new file mode 100644 (file)
index 0000000..e69de29