tests/qapi-schema: Error case tests for features in structs
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20190606153803.5278-4-armbru@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
8aa3a33e44
commit
a00af40425
@ -378,6 +378,12 @@ qapi-schema += event-boxed-empty.json
|
||||
qapi-schema += event-case.json
|
||||
qapi-schema += event-member-invalid-dict.json
|
||||
qapi-schema += event-nest-struct.json
|
||||
qapi-schema += features-bad-type.json
|
||||
qapi-schema += features-duplicate-name.json
|
||||
qapi-schema += features-missing-name.json
|
||||
qapi-schema += features-name-bad-type.json
|
||||
qapi-schema += features-no-list.json
|
||||
qapi-schema += features-unknown-key.json
|
||||
qapi-schema += flat-union-array-branch.json
|
||||
qapi-schema += flat-union-bad-base.json
|
||||
qapi-schema += flat-union-bad-discriminator.json
|
||||
|
1
tests/qapi-schema/features-bad-type.err
Normal file
1
tests/qapi-schema/features-bad-type.err
Normal file
@ -0,0 +1 @@
|
||||
tests/qapi-schema/features-bad-type.json:1: Feature of struct FeatureStruct0 requires a string name
|
1
tests/qapi-schema/features-bad-type.exit
Normal file
1
tests/qapi-schema/features-bad-type.exit
Normal file
@ -0,0 +1 @@
|
||||
1
|
3
tests/qapi-schema/features-bad-type.json
Normal file
3
tests/qapi-schema/features-bad-type.json
Normal file
@ -0,0 +1,3 @@
|
||||
{ 'struct': 'FeatureStruct0',
|
||||
'data': { 'foo': 'int' },
|
||||
'features': [ [ 'a feature cannot be an array' ] ] }
|
0
tests/qapi-schema/features-bad-type.out
Normal file
0
tests/qapi-schema/features-bad-type.out
Normal file
1
tests/qapi-schema/features-duplicate-name.err
Normal file
1
tests/qapi-schema/features-duplicate-name.err
Normal file
@ -0,0 +1 @@
|
||||
tests/qapi-schema/features-duplicate-name.json:1: 'foo' (feature of FeatureStruct0) collides with 'foo' (feature of FeatureStruct0)
|
1
tests/qapi-schema/features-duplicate-name.exit
Normal file
1
tests/qapi-schema/features-duplicate-name.exit
Normal file
@ -0,0 +1 @@
|
||||
1
|
3
tests/qapi-schema/features-duplicate-name.json
Normal file
3
tests/qapi-schema/features-duplicate-name.json
Normal file
@ -0,0 +1,3 @@
|
||||
{ 'struct': 'FeatureStruct0',
|
||||
'data': { 'foo': 'int' },
|
||||
'features': [ 'foo', 'bar', 'foo' ] }
|
0
tests/qapi-schema/features-duplicate-name.out
Normal file
0
tests/qapi-schema/features-duplicate-name.out
Normal file
1
tests/qapi-schema/features-missing-name.err
Normal file
1
tests/qapi-schema/features-missing-name.err
Normal file
@ -0,0 +1 @@
|
||||
tests/qapi-schema/features-missing-name.json:1: Key 'name' is missing from feature of struct FeatureStruct0
|
1
tests/qapi-schema/features-missing-name.exit
Normal file
1
tests/qapi-schema/features-missing-name.exit
Normal file
@ -0,0 +1 @@
|
||||
1
|
3
tests/qapi-schema/features-missing-name.json
Normal file
3
tests/qapi-schema/features-missing-name.json
Normal file
@ -0,0 +1,3 @@
|
||||
{ 'struct': 'FeatureStruct0',
|
||||
'data': { 'foo': 'int' },
|
||||
'features': [ { 'if': 'defined(NAMELESS_FEATURES)' } ] }
|
0
tests/qapi-schema/features-missing-name.out
Normal file
0
tests/qapi-schema/features-missing-name.out
Normal file
1
tests/qapi-schema/features-name-bad-type.err
Normal file
1
tests/qapi-schema/features-name-bad-type.err
Normal file
@ -0,0 +1 @@
|
||||
tests/qapi-schema/features-name-bad-type.json:1: Feature of struct FeatureStruct0 requires a string name
|
1
tests/qapi-schema/features-name-bad-type.exit
Normal file
1
tests/qapi-schema/features-name-bad-type.exit
Normal file
@ -0,0 +1 @@
|
||||
1
|
3
tests/qapi-schema/features-name-bad-type.json
Normal file
3
tests/qapi-schema/features-name-bad-type.json
Normal file
@ -0,0 +1,3 @@
|
||||
{ 'struct': 'FeatureStruct0',
|
||||
'data': { 'foo': 'int' },
|
||||
'features': [ { 'name': { 'feature-type': 'object' } } ] }
|
0
tests/qapi-schema/features-name-bad-type.out
Normal file
0
tests/qapi-schema/features-name-bad-type.out
Normal file
1
tests/qapi-schema/features-no-list.err
Normal file
1
tests/qapi-schema/features-no-list.err
Normal file
@ -0,0 +1 @@
|
||||
tests/qapi-schema/features-no-list.json:1: Struct 'FeatureStruct0' requires an array for 'features'
|
1
tests/qapi-schema/features-no-list.exit
Normal file
1
tests/qapi-schema/features-no-list.exit
Normal file
@ -0,0 +1 @@
|
||||
1
|
3
tests/qapi-schema/features-no-list.json
Normal file
3
tests/qapi-schema/features-no-list.json
Normal file
@ -0,0 +1,3 @@
|
||||
{ 'struct': 'FeatureStruct0',
|
||||
'data': { 'foo': 'int' },
|
||||
'features': 'bar' }
|
0
tests/qapi-schema/features-no-list.out
Normal file
0
tests/qapi-schema/features-no-list.out
Normal file
2
tests/qapi-schema/features-unknown-key.err
Normal file
2
tests/qapi-schema/features-unknown-key.err
Normal file
@ -0,0 +1,2 @@
|
||||
tests/qapi-schema/features-unknown-key.json:1: Unknown key 'colour' in feature of struct FeatureStruct0
|
||||
Valid keys are 'if', 'name'.
|
1
tests/qapi-schema/features-unknown-key.exit
Normal file
1
tests/qapi-schema/features-unknown-key.exit
Normal file
@ -0,0 +1 @@
|
||||
1
|
3
tests/qapi-schema/features-unknown-key.json
Normal file
3
tests/qapi-schema/features-unknown-key.json
Normal file
@ -0,0 +1,3 @@
|
||||
{ 'struct': 'FeatureStruct0',
|
||||
'data': { 'foo': 'int' },
|
||||
'features': [ { 'name': 'bar', 'colour': 'red' } ] }
|
0
tests/qapi-schema/features-unknown-key.out
Normal file
0
tests/qapi-schema/features-unknown-key.out
Normal file
Loading…
Reference in New Issue
Block a user