summaryrefslogtreecommitdiff
path: root/tests/test-opts-visitor.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-opts-visitor.c')
-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 0a9e75f1bb..8befe82918 100644
--- a/tests/test-opts-visitor.c
+++ b/tests/test-opts-visitor.c
@@ -172,6 +172,24 @@ expect_u64_max(OptsVisitorFixture *f, gconstpointer test_data)
/* test cases */
+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)
{
@@ -263,6 +281,8 @@ main(int argc, char **argv)
add_test("/visitor/opts/i64/range/2big/full", &expect_fail,
"i64=-0x8000000000000000-0x7fffffffffffffff");
+ g_test_add_func("/visitor/opts/dict/unvisited", test_opts_dict_unvisited);
+
g_test_run();
return 0;
}