aboutsummaryrefslogtreecommitdiff
path: root/tests/test-qmp-output-visitor.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2014-03-01 08:40:31 +0100
committerLuiz Capitulino <lcapitulino@redhat.com>2014-03-03 11:16:45 -0500
commitaabbd472a08249335d6a004173b30d552cb70d1d (patch)
treebec71e5075989628c63055b7f9b1960b032e6fec /tests/test-qmp-output-visitor.c
parent2c38b600109edcad399ca687024b7a7febd80076 (diff)
downloadqemu-aabbd472a08249335d6a004173b30d552cb70d1d.zip
qemu-aabbd472a08249335d6a004173b30d552cb70d1d.tar.gz
qemu-aabbd472a08249335d6a004173b30d552cb70d1d.tar.bz2
tests/qapi-schema: Cover complex types with base
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'tests/test-qmp-output-visitor.c')
-rw-r--r--tests/test-qmp-output-visitor.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/test-qmp-output-visitor.c b/tests/test-qmp-output-visitor.c
index ae4e68c..6b29849 100644
--- a/tests/test-qmp-output-visitor.c
+++ b/tests/test-qmp-output-visitor.c
@@ -231,13 +231,15 @@ static void test_visitor_out_struct_nested(TestOutputVisitorData *data,
ud2->dict1.string1 = g_strdup(strings[1]);
ud2->dict1.dict2.userdef1 = g_malloc0(sizeof(UserDefOne));
ud2->dict1.dict2.userdef1->string = g_strdup(string);
- ud2->dict1.dict2.userdef1->integer = value;
+ ud2->dict1.dict2.userdef1->base = g_new0(UserDefZero, 1);
+ ud2->dict1.dict2.userdef1->base->integer = value;
ud2->dict1.dict2.string2 = g_strdup(strings[2]);
ud2->dict1.has_dict3 = true;
ud2->dict1.dict3.userdef2 = g_malloc0(sizeof(UserDefOne));
ud2->dict1.dict3.userdef2->string = g_strdup(string);
- ud2->dict1.dict3.userdef2->integer = value;
+ ud2->dict1.dict3.userdef2->base = g_new0(UserDefZero, 1);
+ ud2->dict1.dict3.userdef2->base->integer = value;
ud2->dict1.dict3.string3 = g_strdup(strings[3]);
visit_type_UserDefNested(data->ov, &ud2, "unused", &errp);
@@ -279,7 +281,8 @@ static void test_visitor_out_struct_errors(TestOutputVisitorData *data,
const void *unused)
{
EnumOne bad_values[] = { ENUM_ONE_MAX, -1 };
- UserDefOne u = { 0 }, *pu = &u;
+ UserDefZero b;
+ UserDefOne u = { .base = &b }, *pu = &u;
Error *errp;
int i;
@@ -391,7 +394,8 @@ static void test_visitor_out_list_qapi_free(TestOutputVisitorData *data,
p->value->dict1.string1 = g_strdup(string);
p->value->dict1.dict2.userdef1 = g_malloc0(sizeof(UserDefOne));
p->value->dict1.dict2.userdef1->string = g_strdup(string);
- p->value->dict1.dict2.userdef1->integer = 42;
+ p->value->dict1.dict2.userdef1->base = g_new0(UserDefZero, 1);
+ p->value->dict1.dict2.userdef1->base->integer = 42;
p->value->dict1.dict2.string2 = g_strdup(string);
p->value->dict1.has_dict3 = false;