aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test-opts-visitor.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test-opts-visitor.c b/tests/test-opts-visitor.c
index 2238f8efe5..8e0dda5f68 100644
--- a/tests/test-opts-visitor.c
+++ b/tests/test-opts-visitor.c
@@ -247,6 +247,24 @@ test_opts_range_beyond(void)
qemu_opts_del(opts);
}
+static void
+test_opts_dict_unvisited(void)
+{
+ QemuOpts *opts;
+ Visitor *v;
+ UserDefOptions *userdef;
+
+ opts = qemu_opts_parse(qemu_find_opts("userdef"), "i64x=0,bogus=1", false,
+ &error_abort);
+
+ v = opts_visitor_new(opts);
+ /* BUG: bogus should be diagnosed */
+ visit_type_UserDefOptions(v, NULL, &userdef, &error_abort);
+ visit_free(v);
+ qemu_opts_del(opts);
+ qapi_free_UserDefOptions(userdef);
+}
+
int
main(int argc, char **argv)
{
@@ -343,6 +361,8 @@ main(int argc, char **argv)
g_test_add_func("/visitor/opts/range/beyond",
test_opts_range_beyond);
+ g_test_add_func("/visitor/opts/dict/unvisited", test_opts_dict_unvisited);
+
g_test_run();
return 0;
}