]> git.proxmox.com Git - mirror_qemu.git/blobdiff - tests/test-qemu-opts.c
qobject: Propagate parse errors through qobject_from_json()
[mirror_qemu.git] / tests / test-qemu-opts.c
index c46ef3165896f99df1a5d0d3c5f4c1dfba42c65b..f6310b34f13d1b2724c3cdff4aaf9b511ef815c0 100644 (file)
@@ -532,6 +532,11 @@ static void test_opts_parse(void)
     g_assert_cmpstr(qemu_opt_get(opts, "aus"), ==, "off");
     g_assert_cmpstr(qemu_opt_get(opts, "noaus"), ==, "");
 
+    /* Implied value, negated empty key */
+    opts = qemu_opts_parse(&opts_list_03, "no", false, &error_abort);
+    g_assert_cmpuint(opts_count(opts), ==, 1);
+    g_assert_cmpstr(qemu_opt_get(opts, ""), ==, "off");
+
     /* Implied key */
     opts = qemu_opts_parse(&opts_list_03, "an,noaus,noaus=", true,
                            &error_abort);