]> git.proxmox.com Git - mirror_qemu.git/commit - tests/test-qobject-input-visitor.c
qapi: Share test_init code in test-qmp-input*
authorEric Blake <eblake@redhat.com>
Fri, 6 Nov 2015 06:35:28 +0000 (23:35 -0700)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 9 Nov 2015 15:45:05 +0000 (16:45 +0100)
commit0920a17199d23b3def3a60fa1fbbdeadcdda452d
tree320e23ae43388c7fc04545cca963cf2b4d076d2b
parentcc9f60d4a2a4bf2578a9309a18f1c4602c9f5ce7
qapi: Share test_init code in test-qmp-input*

Rather than duplicate the body of two functions just to
decide between qobject_from_jsonv() and qobject_from_json(),
exploit the fact that qobject_from_jsonv() intentionally
takes 'va_list *' instead of the more common 'va_list', and
that qobject_from_json() just calls qobject_from_jsonv(,NULL).
For each file, our two existing init functions then become
thin wrappers around a new internal function, and future
updates to initialization don't have to be duplicated.

Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1446791754-23823-5-git-send-email-eblake@redhat.com>
[Two old comment typos fixed]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
tests/test-qmp-input-strict.c
tests/test-qmp-input-visitor.c