diff options
author | Markus Armbruster <armbru@redhat.com> | 2019-09-14 17:34:51 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2019-09-24 14:07:22 +0200 |
commit | 31248b985e30801c2676ff448291c2b3d02a1b8c (patch) | |
tree | 0ae34109b2807f6733654bced652c2d0f8669f22 /tests/qapi-schema | |
parent | cd346bdc46eb2046d7f744135a7e3d740490d166 (diff) |
tests/qapi-schema: Demonstrate broken discriminator errors
When the union definition's base is an object, some error messages
show it as an OrderedDict. Oops. Mark FIXME.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190914153506.2151-5-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'tests/qapi-schema')
4 files changed, 6 insertions, 10 deletions
diff --git a/tests/qapi-schema/flat-union-invalid-discriminator.err b/tests/qapi-schema/flat-union-invalid-discriminator.err index 5f4055614e..947a6b73aa 100644 --- a/tests/qapi-schema/flat-union-invalid-discriminator.err +++ b/tests/qapi-schema/flat-union-invalid-discriminator.err @@ -1 +1 @@ -tests/qapi-schema/flat-union-invalid-discriminator.json:13: Discriminator 'enum_wrong' is not a member of base struct 'TestBase' +tests/qapi-schema/flat-union-invalid-discriminator.json:11: Discriminator 'enum_wrong' is not a member of base struct 'OrderedDict([('enum1', {'type': 'TestEnum'})])' diff --git a/tests/qapi-schema/flat-union-invalid-discriminator.json b/tests/qapi-schema/flat-union-invalid-discriminator.json index 48b94c3a4d..de86cf0760 100644 --- a/tests/qapi-schema/flat-union-invalid-discriminator.json +++ b/tests/qapi-schema/flat-union-invalid-discriminator.json @@ -1,9 +1,7 @@ +# FIXME error message shows base as OrderedDict { 'enum': 'TestEnum', 'data': [ 'value1', 'value2' ] } -{ 'struct': 'TestBase', - 'data': { 'enum1': 'TestEnum' } } - { 'struct': 'TestTypeA', 'data': { 'string': 'str' } } @@ -11,7 +9,7 @@ 'data': { 'integer': 'int' } } { 'union': 'TestUnion', - 'base': 'TestBase', + 'base': { 'enum1': 'TestEnum' }, 'discriminator': 'enum_wrong', 'data': { 'value1': 'TestTypeA', 'value2': 'TestTypeB' } } diff --git a/tests/qapi-schema/flat-union-invalid-if-discriminator.err b/tests/qapi-schema/flat-union-invalid-if-discriminator.err index 0c94c9860d..ec04c4840c 100644 --- a/tests/qapi-schema/flat-union-invalid-if-discriminator.err +++ b/tests/qapi-schema/flat-union-invalid-if-discriminator.err @@ -1 +1 @@ -tests/qapi-schema/flat-union-invalid-if-discriminator.json:13: The discriminator TestBase.enum1 for union TestUnion must not be conditional +tests/qapi-schema/flat-union-invalid-if-discriminator.json:11: The discriminator OrderedDict([('enum1', OrderedDict([('type', 'TestEnum'), ('if', 'FOO')]))]).enum1 for union TestUnion must not be conditional diff --git a/tests/qapi-schema/flat-union-invalid-if-discriminator.json b/tests/qapi-schema/flat-union-invalid-if-discriminator.json index 618ec36396..bbaa9a3f82 100644 --- a/tests/qapi-schema/flat-union-invalid-if-discriminator.json +++ b/tests/qapi-schema/flat-union-invalid-if-discriminator.json @@ -1,9 +1,7 @@ +# FIXME error message shows base as OrderedDict { 'enum': 'TestEnum', 'data': [ 'value1', 'value2' ] } -{ 'struct': 'TestBase', - 'data': { 'enum1': { 'type': 'TestEnum', 'if': 'FOO' } } } - { 'struct': 'TestTypeA', 'data': { 'string': 'str' } } @@ -11,7 +9,7 @@ 'data': { 'integer': 'int' } } { 'union': 'TestUnion', - 'base': 'TestBase', + 'base': { 'enum1': { 'type': 'TestEnum', 'if': 'FOO' } }, 'discriminator': 'enum1', 'data': { 'value1': 'TestTypeA', 'value2': 'TestTypeB' } } |