diff --git a/tests/Makefile.include b/tests/Makefile.include index 734c7ff6dace86f970b83b9d88b497b37c8b5a95..e6e00b40e6e76a23e9c7a0b05f4963c505521918 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -367,8 +367,10 @@ qapi-schema += base-cycle-direct.json qapi-schema += base-cycle-indirect.json qapi-schema += command-int.json qapi-schema += comments.json +qapi-schema += doc-bad-alternate-member.json qapi-schema += doc-bad-command-arg.json qapi-schema += doc-bad-symbol.json +qapi-schema += doc-bad-union-member.json qapi-schema += doc-before-include.json qapi-schema += doc-before-pragma.json qapi-schema += doc-duplicated-arg.json diff --git a/tests/qapi-schema/doc-bad-alternate-member.err b/tests/qapi-schema/doc-bad-alternate-member.err new file mode 100644 index 0000000000000000000000000000000000000000..387f7824daa5cf55ad6df8c2339a332ea7930649 --- /dev/null +++ b/tests/qapi-schema/doc-bad-alternate-member.err @@ -0,0 +1 @@ +tests/qapi-schema/doc-bad-alternate-member.json:3: The following documented members are not in the declaration: aa, bb diff --git a/tests/qapi-schema/doc-bad-alternate-member.exit b/tests/qapi-schema/doc-bad-alternate-member.exit new file mode 100644 index 0000000000000000000000000000000000000000..d00491fd7e5bb6fa28c517a0bb32b8b506539d4d --- /dev/null +++ b/tests/qapi-schema/doc-bad-alternate-member.exit @@ -0,0 +1 @@ +1 diff --git a/tests/qapi-schema/doc-bad-alternate-member.json b/tests/qapi-schema/doc-bad-alternate-member.json new file mode 100644 index 0000000000000000000000000000000000000000..738635ca8fd92cf0a53e92416c988d8d1e58a523 --- /dev/null +++ b/tests/qapi-schema/doc-bad-alternate-member.json @@ -0,0 +1,9 @@ +# Arguments listed in the doc comment must exist in the actual schema + +## +# @AorB: +# @aa: a +# @bb: b +## +{ 'alternate': 'AorB', + 'data': { 'a': 'str', 'b': 'int' } } diff --git a/tests/qapi-schema/doc-bad-alternate-member.out b/tests/qapi-schema/doc-bad-alternate-member.out new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/qapi-schema/doc-bad-union-member.err b/tests/qapi-schema/doc-bad-union-member.err new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/qapi-schema/doc-bad-union-member.exit b/tests/qapi-schema/doc-bad-union-member.exit new file mode 100644 index 0000000000000000000000000000000000000000..573541ac9702dd3969c9bc859d2b91ec1f7e6e56 --- /dev/null +++ b/tests/qapi-schema/doc-bad-union-member.exit @@ -0,0 +1 @@ +0 diff --git a/tests/qapi-schema/doc-bad-union-member.json b/tests/qapi-schema/doc-bad-union-member.json new file mode 100644 index 0000000000000000000000000000000000000000..d611435f6ae80b01ecfdde8f7f9334463f61041a --- /dev/null +++ b/tests/qapi-schema/doc-bad-union-member.json @@ -0,0 +1,19 @@ +# Arguments listed in the doc comment must exist in the actual schema + +## +# @Frob: +# @a: a +# @b: b +## +{ 'union': 'Frob', + 'base': 'Base', + 'discriminator': 'type', + 'data': { 'nothing': 'Empty' } } + +{ 'struct': 'Base', + 'data': { 'type': 'T' } } + +{ 'struct': 'Empty', + 'data': { } } + +{ 'enum': 'T', 'data': ['nothing'] } diff --git a/tests/qapi-schema/doc-bad-union-member.out b/tests/qapi-schema/doc-bad-union-member.out new file mode 100644 index 0000000000000000000000000000000000000000..2576ecd0373b5eebf1a169aeff6e47e4d86d6e2d --- /dev/null +++ b/tests/qapi-schema/doc-bad-union-member.out @@ -0,0 +1,11 @@ +object Base + member type: T optional=False +object Empty +object Frob + base Base + tag type + case nothing: Empty +enum QType ['none', 'qnull', 'qint', 'qstring', 'qdict', 'qlist', 'qfloat', 'qbool'] + prefix QTYPE +enum T ['nothing'] +object q_empty