aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarcel Apfelbaum <marcel.a@redhat.com>2014-05-26 15:40:56 +0300
committerAndreas Färber <afaerber@suse.de>2014-05-28 17:36:09 +0200
commita199b2b6a5b9dd50cfe96349778458d1b39899b5 (patch)
tree19f65db8f5dddbec76ba88368b193d319d8fe49f /tests
parent1d10b44546e2605b6dd8a006dcc0d03166649e2d (diff)
tests: Check empty QMP output visitor
Checks the output visitor behaviour for NULL values. Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/test-qmp-output-visitor.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test-qmp-output-visitor.c b/tests/test-qmp-output-visitor.c
index 9c154581d7..74020de5e7 100644
--- a/tests/test-qmp-output-visitor.c
+++ b/tests/test-qmp-output-visitor.c
@@ -507,6 +507,15 @@ static void test_visitor_out_union_anon(TestOutputVisitorData *data,
qapi_free_UserDefAnonUnion(tmp);
}
+static void test_visitor_out_empty(TestOutputVisitorData *data,
+ const void *unused)
+{
+ QObject *arg;
+
+ arg = qmp_output_get_qobject(data->qov);
+ g_assert(!arg);
+}
+
static void init_native_list(UserDefNativeListUnion *cvalue)
{
int i;
@@ -859,6 +868,8 @@ int main(int argc, char **argv)
&out_visitor_data, test_visitor_out_union_flat);
output_visitor_test_add("/visitor/output/union-anon",
&out_visitor_data, test_visitor_out_union_anon);
+ output_visitor_test_add("/visitor/output/empty",
+ &out_visitor_data, test_visitor_out_empty);
output_visitor_test_add("/visitor/output/native_list/int",
&out_visitor_data, test_visitor_out_native_list_int);
output_visitor_test_add("/visitor/output/native_list/int8",