mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-09 00:07:57 -06:00
qapi: Introduce a first class 'null' type
I expect the 'null' type to be useful mostly for members of alternate types. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
d2f95f4d48
commit
4d2d5c41a9
8 changed files with 31 additions and 8 deletions
|
@ -422,6 +422,16 @@ static void test_visitor_out_alternate(TestOutputVisitorData *data,
|
|||
|
||||
qapi_free_UserDefAlternate(tmp);
|
||||
|
||||
visitor_reset(data);
|
||||
tmp = g_new0(UserDefAlternate, 1);
|
||||
tmp->type = QTYPE_QNULL;
|
||||
tmp->u.n = qnull();
|
||||
|
||||
visit_type_UserDefAlternate(data->ov, NULL, &tmp, &error_abort);
|
||||
g_assert_cmpint(qobject_type(visitor_get(data)), ==, QTYPE_QNULL);
|
||||
|
||||
qapi_free_UserDefAlternate(tmp);
|
||||
|
||||
visitor_reset(data);
|
||||
tmp = g_new0(UserDefAlternate, 1);
|
||||
tmp->type = QTYPE_QDICT;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue