diff options
Diffstat (limited to 'tests/qapi-schema')
-rw-r--r-- | tests/qapi-schema/alternate-branch-if-invalid.err | 0 | ||||
-rw-r--r-- | tests/qapi-schema/alternate-branch-if-invalid.exit | 1 | ||||
-rw-r--r-- | tests/qapi-schema/alternate-branch-if-invalid.json | 4 | ||||
-rw-r--r-- | tests/qapi-schema/alternate-branch-if-invalid.out | 16 | ||||
-rw-r--r-- | tests/qapi-schema/features-if-invalid.err | 0 | ||||
-rw-r--r-- | tests/qapi-schema/features-if-invalid.exit | 1 | ||||
-rw-r--r-- | tests/qapi-schema/features-if-invalid.json | 5 | ||||
-rw-r--r-- | tests/qapi-schema/features-if-invalid.out | 14 | ||||
-rw-r--r-- | tests/qapi-schema/struct-member-if-invalid.err | 0 | ||||
-rw-r--r-- | tests/qapi-schema/struct-member-if-invalid.exit | 1 | ||||
-rw-r--r-- | tests/qapi-schema/struct-member-if-invalid.json | 4 | ||||
-rw-r--r-- | tests/qapi-schema/struct-member-if-invalid.out | 15 | ||||
-rw-r--r-- | tests/qapi-schema/union-branch-if-invalid.err | 0 | ||||
-rw-r--r-- | tests/qapi-schema/union-branch-if-invalid.exit | 1 | ||||
-rw-r--r-- | tests/qapi-schema/union-branch-if-invalid.json | 7 | ||||
-rw-r--r-- | tests/qapi-schema/union-branch-if-invalid.out | 23 |
16 files changed, 92 insertions, 0 deletions
diff --git a/tests/qapi-schema/alternate-branch-if-invalid.err b/tests/qapi-schema/alternate-branch-if-invalid.err new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/qapi-schema/alternate-branch-if-invalid.err diff --git a/tests/qapi-schema/alternate-branch-if-invalid.exit b/tests/qapi-schema/alternate-branch-if-invalid.exit new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tests/qapi-schema/alternate-branch-if-invalid.exit @@ -0,0 +1 @@ +0 diff --git a/tests/qapi-schema/alternate-branch-if-invalid.json b/tests/qapi-schema/alternate-branch-if-invalid.json new file mode 100644 index 0000000..6497f53 --- /dev/null +++ b/tests/qapi-schema/alternate-branch-if-invalid.json @@ -0,0 +1,4 @@ +# Cover alternative with invalid 'if' +# FIXME not rejected, would generate '#if \n' +{ 'alternate': 'Alt', + 'data': { 'branch': { 'type': 'int', 'if': ' ' } } } diff --git a/tests/qapi-schema/alternate-branch-if-invalid.out b/tests/qapi-schema/alternate-branch-if-invalid.out new file mode 100644 index 0000000..89305d7 --- /dev/null +++ b/tests/qapi-schema/alternate-branch-if-invalid.out @@ -0,0 +1,16 @@ +module None +object q_empty +enum QType + prefix QTYPE + member none + member qnull + member qnum + member qstring + member qdict + member qlist + member qbool +module alternate-branch-if-invalid.json +alternate Alt + tag type + case branch: int + if [' '] diff --git a/tests/qapi-schema/features-if-invalid.err b/tests/qapi-schema/features-if-invalid.err new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/qapi-schema/features-if-invalid.err diff --git a/tests/qapi-schema/features-if-invalid.exit b/tests/qapi-schema/features-if-invalid.exit new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tests/qapi-schema/features-if-invalid.exit @@ -0,0 +1 @@ +0 diff --git a/tests/qapi-schema/features-if-invalid.json b/tests/qapi-schema/features-if-invalid.json new file mode 100644 index 0000000..7e4c1ad --- /dev/null +++ b/tests/qapi-schema/features-if-invalid.json @@ -0,0 +1,5 @@ +# Cover feature with invalid 'if' +# FIXME not rejected, misinterpreted as unconditional +{ 'struct': 'Stru', + 'data': {}, + 'features': [{'name': 'f', 'if': null }] } diff --git a/tests/qapi-schema/features-if-invalid.out b/tests/qapi-schema/features-if-invalid.out new file mode 100644 index 0000000..9c2637b --- /dev/null +++ b/tests/qapi-schema/features-if-invalid.out @@ -0,0 +1,14 @@ +module None +object q_empty +enum QType + prefix QTYPE + member none + member qnull + member qnum + member qstring + member qdict + member qlist + member qbool +module features-if-invalid.json +object Stru + feature f diff --git a/tests/qapi-schema/struct-member-if-invalid.err b/tests/qapi-schema/struct-member-if-invalid.err new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/qapi-schema/struct-member-if-invalid.err diff --git a/tests/qapi-schema/struct-member-if-invalid.exit b/tests/qapi-schema/struct-member-if-invalid.exit new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tests/qapi-schema/struct-member-if-invalid.exit @@ -0,0 +1 @@ +0 diff --git a/tests/qapi-schema/struct-member-if-invalid.json b/tests/qapi-schema/struct-member-if-invalid.json new file mode 100644 index 0000000..73987e0 --- /dev/null +++ b/tests/qapi-schema/struct-member-if-invalid.json @@ -0,0 +1,4 @@ +# Cover member with invalid 'if' +# FIXME not rejected, would generate '#if True\n' +{ 'struct': 'Stru', + 'data': { 'member': { 'type': 'int', 'if': true } } } diff --git a/tests/qapi-schema/struct-member-if-invalid.out b/tests/qapi-schema/struct-member-if-invalid.out new file mode 100644 index 0000000..8fbb979 --- /dev/null +++ b/tests/qapi-schema/struct-member-if-invalid.out @@ -0,0 +1,15 @@ +module None +object q_empty +enum QType + prefix QTYPE + member none + member qnull + member qnum + member qstring + member qdict + member qlist + member qbool +module struct-member-if-invalid.json +object Stru + member member: int optional=False + if [True] diff --git a/tests/qapi-schema/union-branch-if-invalid.err b/tests/qapi-schema/union-branch-if-invalid.err new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/qapi-schema/union-branch-if-invalid.err diff --git a/tests/qapi-schema/union-branch-if-invalid.exit b/tests/qapi-schema/union-branch-if-invalid.exit new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tests/qapi-schema/union-branch-if-invalid.exit @@ -0,0 +1 @@ +0 diff --git a/tests/qapi-schema/union-branch-if-invalid.json b/tests/qapi-schema/union-branch-if-invalid.json new file mode 100644 index 0000000..859b63b --- /dev/null +++ b/tests/qapi-schema/union-branch-if-invalid.json @@ -0,0 +1,7 @@ +# Cover branch with invalid 'if' +# FIXME not rejected, would generate '#if \n' +{ 'enum': 'Branches', 'data': ['branch1'] } +{ 'struct': 'Stru', 'data': { 'member': 'str' } } +{ 'union': 'Uni', + 'base': { 'tag': 'Branches' }, 'discriminator': 'tag', + 'data': { 'branch1': { 'type': 'Stru', 'if': [''] } } } diff --git a/tests/qapi-schema/union-branch-if-invalid.out b/tests/qapi-schema/union-branch-if-invalid.out new file mode 100644 index 0000000..2ed4321 --- /dev/null +++ b/tests/qapi-schema/union-branch-if-invalid.out @@ -0,0 +1,23 @@ +module None +object q_empty +enum QType + prefix QTYPE + member none + member qnull + member qnum + member qstring + member qdict + member qlist + member qbool +module union-branch-if-invalid.json +enum Branches + member branch1 +object Stru + member member: str optional=False +object q_obj_Uni-base + member tag: Branches optional=False +object Uni + base q_obj_Uni-base + tag tag + case branch1: Stru + if [''] |