aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2017-03-15 13:57:26 +0100
committerMarkus Armbruster <armbru@redhat.com>2017-03-16 07:13:04 +0100
commit816a57cd6ebb6fe820766ac12478a56a5fa33d52 (patch)
tree1f6d4f1946a0c1dcef1fb56d3ae4446426ad2697 /tests
parentf641d06ad63773ae524fb073b2f8639e1db1462c (diff)
downloadqemu-816a57cd6ebb6fe820766ac12478a56a5fa33d52.zip
qemu-816a57cd6ebb6fe820766ac12478a56a5fa33d52.tar.gz
qemu-816a57cd6ebb6fe820766ac12478a56a5fa33d52.tar.bz2
qapi: Fix detection of bogus member documentation
check_definition_doc() checks for member documentation without a matching member. It laboriously second-guesses what members QAPISchema._def_exprs() will create. That's a stupid game. Move the check into QAPISchema.check(), where the members are known. Delegate the actual checking to new QAPIDoc.check(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-38-git-send-email-armbru@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/qapi-schema/doc-bad-union-member.err1
-rw-r--r--tests/qapi-schema/doc-bad-union-member.exit2
-rw-r--r--tests/qapi-schema/doc-bad-union-member.out11
3 files changed, 2 insertions, 12 deletions
diff --git a/tests/qapi-schema/doc-bad-union-member.err b/tests/qapi-schema/doc-bad-union-member.err
index e69de29..4b016df 100644
--- a/tests/qapi-schema/doc-bad-union-member.err
+++ b/tests/qapi-schema/doc-bad-union-member.err
@@ -0,0 +1 @@
+tests/qapi-schema/doc-bad-union-member.json:3: The following documented members are not in the declaration: a, b
diff --git a/tests/qapi-schema/doc-bad-union-member.exit b/tests/qapi-schema/doc-bad-union-member.exit
index 573541a..d00491f 100644
--- a/tests/qapi-schema/doc-bad-union-member.exit
+++ b/tests/qapi-schema/doc-bad-union-member.exit
@@ -1 +1 @@
-0
+1
diff --git a/tests/qapi-schema/doc-bad-union-member.out b/tests/qapi-schema/doc-bad-union-member.out
index 2576ecd..e69de29 100644
--- a/tests/qapi-schema/doc-bad-union-member.out
+++ b/tests/qapi-schema/doc-bad-union-member.out
@@ -1,11 +0,0 @@
-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