aboutsummaryrefslogtreecommitdiff
path: root/tests/qapi-schema/qapi-schema-test.json
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2015-05-04 09:05:27 -0600
committerMarkus Armbruster <armbru@redhat.com>2015-05-05 18:39:01 +0200
commit895a2a80e0e054f0d5d3715aa93d10d15e49f9f7 (patch)
tree0edff3d6c1e8261fcb43826537120cc8e297ec95 /tests/qapi-schema/qapi-schema-test.json
parent3b2a8b85322f3677525a65c0b35deadf45fb704b (diff)
qapi: Use 'struct' instead of 'type' in schema
Referring to "type" as both a meta-type (built-in, enum, union, alternate, or struct) and a specific type (the name that the schema uses for declaring structs) is confusing. Do the bulk of the conversion to "struct" in qapi schema, with a fairly mechanical: for f in `find -name '*.json'; do sed -i "s/'type'/'struct'/"; done followed by manually filtering out the places where we have a 'type' embedded in 'data'. Then tweak a couple of tests whose output changes slightly due to longer lines. I also verified that the generated files for QMP and QGA (such as qmp-commands.h) are the same before and after, as assurance that I didn't leave in any accidental member name changes. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'tests/qapi-schema/qapi-schema-test.json')
-rw-r--r--tests/qapi-schema/qapi-schema-test.json22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/qapi-schema/qapi-schema-test.json b/tests/qapi-schema/qapi-schema-test.json
index dec8a7c108..f10efe2e2f 100644
--- a/tests/qapi-schema/qapi-schema-test.json
+++ b/tests/qapi-schema/qapi-schema-test.json
@@ -3,40 +3,40 @@
# for testing enums
{ 'enum': 'EnumOne',
'data': [ 'value1', 'value2', 'value3' ] }
-{ 'type': 'NestedEnumsOne',
+{ 'struct': 'NestedEnumsOne',
'data': { 'enum1': 'EnumOne', '*enum2': 'EnumOne', 'enum3': 'EnumOne', '*enum4': 'EnumOne' } }
# for testing nested structs
-{ 'type': 'UserDefZero',
+{ 'struct': 'UserDefZero',
'data': { 'integer': 'int' } }
-{ 'type': 'UserDefOne',
+{ 'struct': 'UserDefOne',
'base': 'UserDefZero',
'data': { 'string': 'str', '*enum1': 'EnumOne' } }
-{ 'type': 'UserDefTwo',
+{ 'struct': 'UserDefTwo',
'data': { 'string': 'str',
'dict': { 'string': 'str',
'dict': { 'userdef': 'UserDefOne', 'string': 'str' },
'*dict2': { 'userdef': 'UserDefOne', 'string': 'str' } } } }
-{ 'type': 'UserDefNested',
+{ 'struct': 'UserDefNested',
'data': { 'string0': 'str',
'dict1': { 'string1': 'str',
'dict2': { 'userdef1': 'UserDefOne', 'string2': 'str' },
'*dict3': { 'userdef2': 'UserDefOne', 'string3': 'str' } } } }
# for testing unions
-{ 'type': 'UserDefA',
+{ 'struct': 'UserDefA',
'data': { 'boolean': 'bool' } }
-{ 'type': 'UserDefB',
+{ 'struct': 'UserDefB',
'data': { 'integer': 'int' } }
-{ 'type': 'UserDefC',
+{ 'struct': 'UserDefC',
'data': { 'string1': 'str', 'string2': 'str' } }
-{ 'type': 'UserDefUnionBase',
+{ 'struct': 'UserDefUnionBase',
'data': { 'string': 'str', 'enum1': 'EnumOne' } }
{ 'union': 'UserDefFlatUnion',
@@ -88,7 +88,7 @@
#
# For simplicity, this example doesn't use [type=]discriminator nor optargs
# specific to discriminator values.
-{ 'type': 'UserDefOptions',
+{ 'struct': 'UserDefOptions',
'data': {
'*i64' : [ 'int' ],
'*u64' : [ 'uint64' ],
@@ -97,7 +97,7 @@
'*u64x': 'uint64' } }
# testing event
-{ 'type': 'EventStructOne',
+{ 'struct': 'EventStructOne',
'data': { 'struct1': 'UserDefOne', 'string': 'str', '*enum2': 'EnumOne' } }
{ 'event': 'EVENT_A' }