]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/qemu-xen.git/commitdiff
qapi: More rigourous checking of types
authorEric Blake <eblake@redhat.com>
Mon, 4 May 2015 15:05:21 +0000 (09:05 -0600)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 5 May 2015 16:39:01 +0000 (18:39 +0200)
Now that we know every expression is valid with regards to
its keys, we can add further tests that those keys refer to
valid types.  With this patch, all uses of a type (the 'data':
of command, type, union, alternate, and event; the 'returns':
of command; the 'base': of type and union) must resolve to an
appropriate subset of metatypes  declared by the current qapi
parse; this includes recursing into each member of a data
dictionary.  Dealing with '**' and nested anonymous structs
will be done in later patches.

Update the testsuite to match improved output.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
52 files changed:
scripts/qapi.py
tests/qapi-schema/alternate-array.err
tests/qapi-schema/alternate-nested.err
tests/qapi-schema/alternate-unknown.err
tests/qapi-schema/bad-base.err
tests/qapi-schema/bad-base.exit
tests/qapi-schema/bad-base.json
tests/qapi-schema/bad-base.out
tests/qapi-schema/bad-data.err
tests/qapi-schema/bad-data.exit
tests/qapi-schema/bad-data.json
tests/qapi-schema/bad-data.out
tests/qapi-schema/data-array-empty.err
tests/qapi-schema/data-array-empty.exit
tests/qapi-schema/data-array-empty.json
tests/qapi-schema/data-array-empty.out
tests/qapi-schema/data-array-unknown.err
tests/qapi-schema/data-array-unknown.exit
tests/qapi-schema/data-array-unknown.json
tests/qapi-schema/data-array-unknown.out
tests/qapi-schema/data-int.err
tests/qapi-schema/data-int.exit
tests/qapi-schema/data-int.json
tests/qapi-schema/data-int.out
tests/qapi-schema/data-member-array-bad.err
tests/qapi-schema/data-member-array-bad.exit
tests/qapi-schema/data-member-array-bad.json
tests/qapi-schema/data-member-array-bad.out
tests/qapi-schema/data-member-unknown.err
tests/qapi-schema/data-member-unknown.exit
tests/qapi-schema/data-member-unknown.json
tests/qapi-schema/data-member-unknown.out
tests/qapi-schema/data-unknown.err
tests/qapi-schema/data-unknown.exit
tests/qapi-schema/data-unknown.json
tests/qapi-schema/data-unknown.out
tests/qapi-schema/flat-union-int-branch.err
tests/qapi-schema/flat-union-int-branch.exit
tests/qapi-schema/flat-union-int-branch.json
tests/qapi-schema/flat-union-int-branch.out
tests/qapi-schema/returns-array-bad.err
tests/qapi-schema/returns-array-bad.exit
tests/qapi-schema/returns-array-bad.json
tests/qapi-schema/returns-array-bad.out
tests/qapi-schema/returns-unknown.err
tests/qapi-schema/returns-unknown.exit
tests/qapi-schema/returns-unknown.json
tests/qapi-schema/returns-unknown.out
tests/qapi-schema/union-unknown.err
tests/qapi-schema/union-unknown.exit
tests/qapi-schema/union-unknown.json
tests/qapi-schema/union-unknown.out

index 1dd91eed421aa34f5f041699df6bd56957cc8e23..3c33e4e46c0aa536862ed508c8b1ffeae3f67bdc 100644 (file)
@@ -276,6 +276,64 @@ def discriminator_find_enum_define(expr):
 
     return find_enum(discriminator_type)
 
+def check_type(expr_info, source, value, allow_array = False,
+               allow_dict = False, allow_metas = []):
+    global all_names
+    orig_value = value
+
+    if value is None:
+        return
+
+    if value == '**':
+        return
+
+    # Check if array type for value is okay
+    if isinstance(value, list):
+        if not allow_array:
+            raise QAPIExprError(expr_info,
+                                "%s cannot be an array" % source)
+        if len(value) != 1 or not isinstance(value[0], str):
+            raise QAPIExprError(expr_info,
+                                "%s: array type must contain single type name"
+                                % source)
+        value = value[0]
+        orig_value = "array of %s" %value
+
+    # Check if type name for value is okay
+    if isinstance(value, str):
+        if not value in all_names:
+            raise QAPIExprError(expr_info,
+                                "%s uses unknown type '%s'"
+                                % (source, orig_value))
+        if not all_names[value] in allow_metas:
+            raise QAPIExprError(expr_info,
+                                "%s cannot use %s type '%s'"
+                                % (source, all_names[value], orig_value))
+        return
+
+    # value is a dictionary, check that each member is okay
+    if not isinstance(value, OrderedDict):
+        raise QAPIExprError(expr_info,
+                            "%s should be a dictionary" % source)
+    if not allow_dict:
+        raise QAPIExprError(expr_info,
+                            "%s should be a type name" % source)
+    for (key, arg) in value.items():
+        check_type(expr_info, "Member '%s' of %s" % (key, source), arg,
+                   allow_array=True, allow_dict=True,
+                   allow_metas=['built-in', 'union', 'alternate', 'struct',
+                                'enum'])
+
+def check_command(expr, expr_info):
+    name = expr['command']
+    check_type(expr_info, "'data' for command '%s'" % name,
+               expr.get('data'), allow_dict=True,
+               allow_metas=['union', 'struct'])
+    check_type(expr_info, "'returns' for command '%s'" % name,
+               expr.get('returns'), allow_array=True, allow_dict=True,
+               allow_metas=['built-in', 'union', 'alternate', 'struct',
+                            'enum'])
+
 def check_event(expr, expr_info):
     global events
     name = expr['event']
@@ -284,7 +342,9 @@ def check_event(expr, expr_info):
     if name.upper() == 'MAX':
         raise QAPIExprError(expr_info, "Event name 'MAX' cannot be created")
     events.append(name)
-
+    check_type(expr_info, "'data' for event '%s'" % name,
+               expr.get('data'), allow_dict=True,
+               allow_metas=['union', 'struct'])
     if params:
         for argname, argentry, optional, structured in parse_args(params):
             if structured:
@@ -313,6 +373,7 @@ def check_union(expr, expr_info):
     # With no discriminator it is a simple union.
     if discriminator is None:
         enum_define = None
+        allow_metas=['built-in', 'union', 'alternate', 'struct', 'enum']
         if base is not None:
             raise QAPIExprError(expr_info,
                                 "Simple union '%s' must not have a base"
@@ -344,6 +405,7 @@ def check_union(expr, expr_info):
                                 "type '%s'"
                                 % (discriminator, base))
         enum_define = find_enum(discriminator_type)
+        allow_metas=['struct']
         # Do not allow string discriminator
         if not enum_define:
             raise QAPIExprError(expr_info,
@@ -352,6 +414,11 @@ def check_union(expr, expr_info):
 
     # Check every branch
     for (key, value) in members.items():
+        # Each value must name a known type; furthermore, in flat unions,
+        # branches must be a struct
+        check_type(expr_info, "Member '%s' of union '%s'" % (key, name),
+                   value, allow_array=True, allow_metas=allow_metas)
+
         # If the discriminator names an enum type, then all members
         # of 'data' must also be members of the enum type.
         if enum_define:
@@ -387,15 +454,11 @@ def check_alternate(expr, expr_info):
         values[c_key] = key
 
         # Ensure alternates have no type conflicts.
-        if isinstance(value, list):
-            raise QAPIExprError(expr_info,
-                                "Alternate '%s' member '%s' must "
-                                "not be array type" % (name, key))
+        check_type(expr_info, "Member '%s' of alternate '%s'" % (key, name),
+                   value,
+                   allow_metas=['built-in', 'union', 'struct', 'enum'])
         qtype = find_alternate_member_qtype(value)
-        if not qtype:
-            raise QAPIExprError(expr_info,
-                                "Alternate '%s' member '%s' has "
-                                "invalid type '%s'" % (name, key, value))
+        assert qtype
         if qtype in types_seen:
             raise QAPIExprError(expr_info,
                                 "Alternate '%s' member '%s' can't "
@@ -423,6 +486,15 @@ def check_enum(expr, expr_info):
                                 % (name, member, values[key]))
         values[key] = member
 
+def check_struct(expr, expr_info):
+    name = expr['type']
+    members = expr['data']
+
+    check_type(expr_info, "'data' for type '%s'" % name, members,
+               allow_dict=True)
+    check_type(expr_info, "'base' for type '%s'" % name, expr.get('base'),
+               allow_metas=['struct'])
+
 def check_exprs(schema):
     for expr_elem in schema.exprs:
         expr = expr_elem['expr']
@@ -434,8 +506,14 @@ def check_exprs(schema):
             check_union(expr, info)
         elif expr.has_key('alternate'):
             check_alternate(expr, info)
+        elif expr.has_key('type'):
+            check_struct(expr, info)
+        elif expr.has_key('command'):
+            check_command(expr, info)
         elif expr.has_key('event'):
             check_event(expr, info)
+        else:
+            assert False, 'unexpected meta type'
 
 def check_keys(expr_elem, meta, required, optional=[]):
     expr = expr_elem['expr']
index e2a5fc29bf28ff0476de35f43a9be8dee079284c..7b930c64abf6baebc4d283e3b2ab99f0ac01139b 100644 (file)
@@ -1 +1 @@
-tests/qapi-schema/alternate-array.json:5: Alternate 'Alt' member 'two' must not be array type
+tests/qapi-schema/alternate-array.json:5: Member 'two' of alternate 'Alt' cannot be an array
index 00b05c601ec8cfbc2dd5873354e7359f0b8ca9b5..4d1187e60ec0df48eb2e04a943f241e7ca78d372 100644 (file)
@@ -1 +1 @@
-tests/qapi-schema/alternate-nested.json:4: Alternate 'Alt2' member 'nested' has invalid type 'Alt1'
+tests/qapi-schema/alternate-nested.json:4: Member 'nested' of alternate 'Alt2' cannot use alternate type 'Alt1'
index 7af1b4c5693b8805b88b6ad85893de6e00b037fa..dea45dc7302d4cc58701edf29290ad11c7cbbce8 100644 (file)
@@ -1 +1 @@
-tests/qapi-schema/alternate-unknown.json:2: Alternate 'Alt' member 'unknown' has invalid type 'MissingType'
+tests/qapi-schema/alternate-unknown.json:2: Member 'unknown' of alternate 'Alt' uses unknown type 'MissingType'
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f398bbb7d3f41d2dbfcf7ba8b76829288f699918 100644 (file)
@@ -0,0 +1 @@
+tests/qapi-schema/bad-base.json:3: 'base' for type 'MyType' cannot use union type 'Union'
index 573541ac9702dd3969c9bc859d2b91ec1f7e6e56..d00491fd7e5bb6fa28c517a0bb32b8b506539d4d 100644 (file)
@@ -1 +1 @@
-0
+1
index de964a0e808fcc9bae5ebadabe58a7820f4e036a..a6904706ad87da10787ca1433bfd37eac4e63a1c 100644 (file)
@@ -1,3 +1,3 @@
-# FIXME: we should reject a base that is not a struct
+# we reject a base that is not a struct
 { 'union': 'Union', 'data': { 'a': 'int', 'b': 'str' } }
 { 'type': 'MyType', 'base': 'Union', 'data': { 'c': 'int' } }
index 91d12fcf6dc0abd5d70fa9d1e7fd857eeedf2949..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,4 +0,0 @@
-[OrderedDict([('union', 'Union'), ('data', OrderedDict([('a', 'int'), ('b', 'str')]))]),
- OrderedDict([('type', 'MyType'), ('base', 'Union'), ('data', OrderedDict([('c', 'int')]))])]
-[{'enum_name': 'UnionKind', 'enum_values': None}]
-[OrderedDict([('type', 'MyType'), ('base', 'Union'), ('data', OrderedDict([('c', 'int')]))])]
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..8523ac4f46d6bb1984c78ca275edb8b42c179622 100644 (file)
@@ -0,0 +1 @@
+tests/qapi-schema/bad-data.json:2: 'data' for command 'oops' cannot be an array
index 573541ac9702dd3969c9bc859d2b91ec1f7e6e56..d00491fd7e5bb6fa28c517a0bb32b8b506539d4d 100644 (file)
@@ -1 +1 @@
-0
+1
index ff1616dd967347d22dc261932bf2a496508cdeec..832eeb76f4cc088e4da5c08941994d125c45aca0 100644 (file)
@@ -1,2 +1,2 @@
-# FIXME: we should ensure 'data' is a dictionary for all but enums
+# we ensure 'data' is a dictionary for all but enums
 { 'command': 'oops', 'data': [ ] }
index 67802be93ce4a683e45647f87a81fe35a2024e32..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,3 +0,0 @@
-[OrderedDict([('command', 'oops'), ('data', [])])]
-[]
-[]
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f713f148938e2d669976743e086da8e3596c5e54 100644 (file)
@@ -0,0 +1 @@
+tests/qapi-schema/data-array-empty.json:2: Member 'empty' of 'data' for command 'oops': array type must contain single type name
index 573541ac9702dd3969c9bc859d2b91ec1f7e6e56..d00491fd7e5bb6fa28c517a0bb32b8b506539d4d 100644 (file)
@@ -1 +1 @@
-0
+1
index edb543a75d406738d0acf97c74cacfb4cf7217d6..652dcfb24a9b8cbe44c7c8ec93b8f44236afe420 100644 (file)
@@ -1,2 +1,2 @@
-# FIXME: we should reject an array for data if it does not contain a known type
+# we reject an array for data if it does not contain a known type
 { 'command': 'oops', 'data': { 'empty': [ ] } }
index 6f25c9e18a564c62ae758ab155f92cfd47f580d4..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,3 +0,0 @@
-[OrderedDict([('command', 'oops'), ('data', OrderedDict([('empty', [])]))])]
-[]
-[]
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..8b731bbcc8bd9b7517009807cba38286365a627b 100644 (file)
@@ -0,0 +1 @@
+tests/qapi-schema/data-array-unknown.json:2: Member 'array' of 'data' for command 'oops' uses unknown type 'array of NoSuchType'
index 573541ac9702dd3969c9bc859d2b91ec1f7e6e56..d00491fd7e5bb6fa28c517a0bb32b8b506539d4d 100644 (file)
@@ -1 +1 @@
-0
+1
index 20cd3c0c302de36d310a685161d155024517ea46..6f3e883315c634c24bb4d2f77281647d016942c8 100644 (file)
@@ -1,2 +1,2 @@
-# FIXME: we should reject an array for data if it does not contain a known type
+# we reject an array for data if it does not contain a known type
 { 'command': 'oops', 'data': { 'array': [ 'NoSuchType' ] } }
index 4314ab5dfa06b279280476a836dcc8076b1c49dd..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,3 +0,0 @@
-[OrderedDict([('command', 'oops'), ('data', OrderedDict([('array', ['NoSuchType'])]))])]
-[]
-[]
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..1a9b077c063d757a9b24734a78086704879cef15 100644 (file)
@@ -0,0 +1 @@
+tests/qapi-schema/data-int.json:2: 'data' for command 'oops' cannot use built-in type 'int'
index 573541ac9702dd3969c9bc859d2b91ec1f7e6e56..d00491fd7e5bb6fa28c517a0bb32b8b506539d4d 100644 (file)
@@ -1 +1 @@
-0
+1
index 37916e09a954e89886cfa083b7cf9c0ede3b9645..a334d92e8ccefd1999c37f00bbcc9943b9578bad 100644 (file)
@@ -1,2 +1,2 @@
-# FIXME: we should reject commands where data is not an array or complex type
+# we reject commands where data is not an array or complex type
 { 'command': 'oops', 'data': 'int' }
index e589a4ff9227465bfbe753b33c89ed54f94c2d3d..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,3 +0,0 @@
-[OrderedDict([('command', 'oops'), ('data', 'int')])]
-[]
-[]
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..2c072d5986812598a07ca86e06ac3099a37f41fc 100644 (file)
@@ -0,0 +1 @@
+tests/qapi-schema/data-member-array-bad.json:2: Member 'member' of 'data' for command 'oops': array type must contain single type name
index 573541ac9702dd3969c9bc859d2b91ec1f7e6e56..d00491fd7e5bb6fa28c517a0bb32b8b506539d4d 100644 (file)
@@ -1 +1 @@
-0
+1
index c954af13eeee93e0faa9efcfd858ab8c8b489365..b2ff144ec632c5975c7e24847cc14a4898bdb452 100644 (file)
@@ -1,2 +1,2 @@
-# FIXME: we should reject data if it does not contain a valid array type
+# we reject data if it does not contain a valid array type
 { 'command': 'oops', 'data': { 'member': [ { 'nested': 'str' } ] } }
index 0e00c4171c201b257cb6cc05a0fcb0045f02cc4c..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,3 +0,0 @@
-[OrderedDict([('command', 'oops'), ('data', OrderedDict([('member', [OrderedDict([('nested', 'str')])])]))])]
-[]
-[]
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ab905db802b9852d98e2b4cbae786eac245623f8 100644 (file)
@@ -0,0 +1 @@
+tests/qapi-schema/data-member-unknown.json:2: Member 'member' of 'data' for command 'oops' uses unknown type 'NoSuchType'
index 573541ac9702dd3969c9bc859d2b91ec1f7e6e56..d00491fd7e5bb6fa28c517a0bb32b8b506539d4d 100644 (file)
@@ -1 +1 @@
-0
+1
index 40e6252c1dbb5c51c288d514f90eb41eee347cfa..342a41ec90e70339f51e58f5f4ce083872238706 100644 (file)
@@ -1,2 +1,2 @@
-# FIXME: we should reject data if it does not contain a known type
+# we reject data if it does not contain a known type
 { 'command': 'oops', 'data': { 'member': 'NoSuchType' } }
index 36252a5f73aacb86e13a50a21fea299d19881eaf..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,3 +0,0 @@
-[OrderedDict([('command', 'oops'), ('data', OrderedDict([('member', 'NoSuchType')]))])]
-[]
-[]
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..5b07277a951c9ff492febeddd11cc35d4fe15f0e 100644 (file)
@@ -0,0 +1 @@
+tests/qapi-schema/data-unknown.json:2: 'data' for command 'oops' uses unknown type 'NoSuchType'
index 573541ac9702dd3969c9bc859d2b91ec1f7e6e56..d00491fd7e5bb6fa28c517a0bb32b8b506539d4d 100644 (file)
@@ -1 +1 @@
-0
+1
index 776bd342e5af19828a6ffa2bcd4a26092da417ab..32aba43b3f8c495e4453b0731c5571474a9e1a38 100644 (file)
@@ -1,2 +1,2 @@
-# FIXME: we should reject data if it does not contain a known type
+# we reject data if it does not contain a known type
 { 'command': 'oops', 'data': 'NoSuchType' }
index 2c60726881833c769904c7c92c8015d77e393aca..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,3 +0,0 @@
-[OrderedDict([('command', 'oops'), ('data', 'NoSuchType')])]
-[]
-[]
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..faf01573b79db7826661c290f3d273848292ef51 100644 (file)
@@ -0,0 +1 @@
+tests/qapi-schema/flat-union-int-branch.json:8: Member 'value1' of union 'TestUnion' cannot use built-in type 'int'
index 573541ac9702dd3969c9bc859d2b91ec1f7e6e56..d00491fd7e5bb6fa28c517a0bb32b8b506539d4d 100644 (file)
@@ -1 +1 @@
-0
+1
index 3543215436a4bc43cdde41d5e5a5f18a9bd440fb..d373131653dfa2372eda9dd9fe935a137da4e800 100644 (file)
@@ -1,4 +1,4 @@
-# FIXME: we should require flat union branches to be a complex type
+# we require flat union branches to be a complex type
 { 'enum': 'TestEnum',
   'data': [ 'value1', 'value2' ] }
 { 'type': 'Base',
index cd40e6c198ddbc1e2cf4c8357d91b97363b477bc..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,7 +0,0 @@
-[OrderedDict([('enum', 'TestEnum'), ('data', ['value1', 'value2'])]),
- OrderedDict([('type', 'Base'), ('data', OrderedDict([('enum1', 'TestEnum')]))]),
- OrderedDict([('type', 'TestTypeB'), ('data', OrderedDict([('integer', 'int')]))]),
- OrderedDict([('union', 'TestUnion'), ('base', 'Base'), ('discriminator', 'enum1'), ('data', OrderedDict([('value1', 'int'), ('value2', 'TestTypeB')]))])]
-[{'enum_name': 'TestEnum', 'enum_values': ['value1', 'value2']}]
-[OrderedDict([('type', 'Base'), ('data', OrderedDict([('enum1', 'TestEnum')]))]),
- OrderedDict([('type', 'TestTypeB'), ('data', OrderedDict([('integer', 'int')]))])]
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..138095ccde1cfb056cb088bd6be2b56b43165cab 100644 (file)
@@ -0,0 +1 @@
+tests/qapi-schema/returns-array-bad.json:2: 'returns' for command 'oops': array type must contain single type name
index 573541ac9702dd3969c9bc859d2b91ec1f7e6e56..d00491fd7e5bb6fa28c517a0bb32b8b506539d4d 100644 (file)
@@ -1 +1 @@
-0
+1
index 14882c1e45579f47c7fcb0158dd1ee486b57f68f..09b0b1f1827a182abb6eb0f8187a30afcc5d2f61 100644 (file)
@@ -1,2 +1,2 @@
-# FIXME: we should reject an array return that is not a single type
+# we reject an array return that is not a single type
 { 'command': 'oops', 'returns': [ 'str', 'str' ] }
index eccad55219c1dee7b6ac2dff06ab227d49d1be74..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,3 +0,0 @@
-[OrderedDict([('command', 'oops'), ('returns', ['str', 'str'])])]
-[]
-[]
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..1f43e3ac9f6116ab2a78b99e468fa7f2fdd432bf 100644 (file)
@@ -0,0 +1 @@
+tests/qapi-schema/returns-unknown.json:2: 'returns' for command 'oops' uses unknown type 'NoSuchType'
index 573541ac9702dd3969c9bc859d2b91ec1f7e6e56..d00491fd7e5bb6fa28c517a0bb32b8b506539d4d 100644 (file)
@@ -1 +1 @@
-0
+1
index 61f20ebb025e9a5374c146cc10b76e8310a05621..25bd498bffb7dd35b28abba85e3c459006b90161 100644 (file)
@@ -1,2 +1,2 @@
-# FIXME: we should reject returns if it does not contain a known type
+# we reject returns if it does not contain a known type
 { 'command': 'oops', 'returns': 'NoSuchType' }
index a482c837ce1d51a3b745f3be4894a8e472b3c611..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,3 +0,0 @@
-[OrderedDict([('command', 'oops'), ('returns', 'NoSuchType')])]
-[]
-[]
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..54fe456f9cd850132c752aaaefd81f27183b7826 100644 (file)
@@ -0,0 +1 @@
+tests/qapi-schema/union-unknown.json:2: Member 'unknown' of union 'Union' uses unknown type 'MissingType'
index 573541ac9702dd3969c9bc859d2b91ec1f7e6e56..d00491fd7e5bb6fa28c517a0bb32b8b506539d4d 100644 (file)
@@ -1 +1 @@
-0
+1
index 258f1d38219cf7cbae858779e0bb731221f7fa74..aa7e8143d81b5142a976a2f3add1a4ab79eca2b4 100644 (file)
@@ -1,3 +1,3 @@
-# FIXME: we should reject a union with unknown type in branch
+# we reject a union with unknown type in branch
 { 'union': 'Union',
   'data': { 'unknown': 'MissingType' } }
index 8223dcf2c053eb3be635e77727545e08dd67ab04..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,3 +0,0 @@
-[OrderedDict([('union', 'Union'), ('data', OrderedDict([('unknown', 'MissingType')]))])]
-[{'enum_name': 'UnionKind', 'enum_values': None}]
-[]