OSDN Git Service

qapi: Reuse code for flat union base validation
authorEric Blake <eblake@redhat.com>
Tue, 29 Sep 2015 22:21:07 +0000 (16:21 -0600)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 12 Oct 2015 16:46:49 +0000 (18:46 +0200)
commit376863ef4895ae709aadb6f26365a5973310ef09
treec12bb1e568857c788a7dc6bfad1e3dc32c7c61e9
parent9c51b4412959c5331a8a931d848c4b755b5bb36a
qapi: Reuse code for flat union base validation

Rather than open-code the check for a valid base type, we
should reuse the common functionality. This allows for
consistent error messages, and also makes it easier for a
later patch to turn on support for inline anonymous base
structures.

Test flat-union-inline is updated to test only one feature
(anonymous branch dictionaries), which can be implemented
independently (test flat-union-bad-base already covers the
idea of an anonymous base dictionary).

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1443565276-4535-10-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
scripts/qapi.py
tests/qapi-schema/flat-union-bad-base.err
tests/qapi-schema/flat-union-base-any.err
tests/qapi-schema/flat-union-base-union.err
tests/qapi-schema/flat-union-inline.err
tests/qapi-schema/flat-union-inline.json
tests/qapi-schema/flat-union-no-base.err
tests/qapi-schema/union-invalid-base.err