Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> --- tests/Makefile.include | 2 ++ tests/qapi-schema/struct-if-invalid.err | 1 + tests/qapi-schema/struct-if-invalid.exit | 1 + tests/qapi-schema/struct-if-invalid.json | 3 +++ tests/qapi-schema/struct-if-invalid.out | 0 tests/qapi-schema/struct-member-type.err | 0 tests/qapi-schema/struct-member-type.exit | 1 + tests/qapi-schema/struct-member-type.json | 1 + tests/qapi-schema/struct-member-type.out | 5 +++++ 9 files changed, 14 insertions(+) create mode 100644 tests/qapi-schema/struct-if-invalid.err create mode 100644 tests/qapi-schema/struct-if-invalid.exit create mode 100644 tests/qapi-schema/struct-if-invalid.json create mode 100644 tests/qapi-schema/struct-if-invalid.out create mode 100644 tests/qapi-schema/struct-member-type.err create mode 100644 tests/qapi-schema/struct-member-type.exit create mode 100644 tests/qapi-schema/struct-member-type.json create mode 100644 tests/qapi-schema/struct-member-type.out
diff --git a/tests/Makefile.include b/tests/Makefile.include index 1c5ce6519e..e00cb9833b 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -512,7 +512,9 @@ qapi-schema += returns-whitelist.json qapi-schema += struct-base-clash-deep.json qapi-schema += struct-base-clash.json qapi-schema += struct-data-invalid.json +qapi-schema += struct-if-invalid.json qapi-schema += struct-member-invalid.json +qapi-schema += struct-member-type.json qapi-schema += trailing-comma-list.json qapi-schema += trailing-comma-object.json qapi-schema += type-bypass-bad-gen.json diff --git a/tests/qapi-schema/struct-if-invalid.err b/tests/qapi-schema/struct-if-invalid.err new file mode 100644 index 0000000000..42245262a9 --- /dev/null +++ b/tests/qapi-schema/struct-if-invalid.err @@ -0,0 +1 @@ +tests/qapi-schema/struct-if-invalid.json:2: Member 'bar' of 'data' for struct 'TestIfStruct' should be a type name diff --git a/tests/qapi-schema/struct-if-invalid.exit b/tests/qapi-schema/struct-if-invalid.exit new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/tests/qapi-schema/struct-if-invalid.exit @@ -0,0 +1 @@ +1 diff --git a/tests/qapi-schema/struct-if-invalid.json b/tests/qapi-schema/struct-if-invalid.json new file mode 100644 index 0000000000..466cdb61e1 --- /dev/null +++ b/tests/qapi-schema/struct-if-invalid.json @@ -0,0 +1,3 @@ +# check missing 'type' +{ 'struct': 'TestIfStruct', 'data': + { 'foo': 'int', 'bar': { 'if': 'defined(TEST_IF_STRUCT_BAR)' } } } diff --git a/tests/qapi-schema/struct-if-invalid.out b/tests/qapi-schema/struct-if-invalid.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/qapi-schema/struct-member-type.err b/tests/qapi-schema/struct-member-type.err new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/qapi-schema/struct-member-type.exit b/tests/qapi-schema/struct-member-type.exit new file mode 100644 index 0000000000..573541ac97 --- /dev/null +++ b/tests/qapi-schema/struct-member-type.exit @@ -0,0 +1 @@ +0 diff --git a/tests/qapi-schema/struct-member-type.json b/tests/qapi-schema/struct-member-type.json new file mode 100644 index 0000000000..07de38fa4a --- /dev/null +++ b/tests/qapi-schema/struct-member-type.json @@ -0,0 +1 @@ +{ 'struct': 'foo', 'data': { 'a': { 'type': 'str' } } } diff --git a/tests/qapi-schema/struct-member-type.out b/tests/qapi-schema/struct-member-type.out new file mode 100644 index 0000000000..2ea68909a9 --- /dev/null +++ b/tests/qapi-schema/struct-member-type.out @@ -0,0 +1,5 @@ +enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool'] + prefix QTYPE +object foo + member a: str optional=False +object q_empty -- 2.14.1.146.gd35faa819