[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH 01/24] test-qemu-opts: Cover qemu_opts_parse() of "n
From: |
Markus Armbruster |
Subject: |
[Qemu-block] [PATCH 01/24] test-qemu-opts: Cover qemu_opts_parse() of "no" |
Date: |
Mon, 27 Feb 2017 12:20:27 +0100 |
qemu_opts_parse() interprets "no" as negated empty key. Consistent
with its acceptance of empty keys elsewhere, whatever that's worth.
Signed-off-by: Markus Armbruster <address@hidden>
---
tests/test-qemu-opts.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/test-qemu-opts.c b/tests/test-qemu-opts.c
index c46ef31..f6310b3 100644
--- a/tests/test-qemu-opts.c
+++ b/tests/test-qemu-opts.c
@@ -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);
--
2.7.4
- Re: [Qemu-block] [PATCH 23/24] keyval: Restrict key components to valid QAPI names, (continued)
- [Qemu-block] [PATCH 21/24] test-qapi-util: New, covering qapi/qapi-util.c, Markus Armbruster, 2017/02/27
- [Qemu-block] [PATCH 16/24] monitor: Assert qmp_schema_json[] is sane, Markus Armbruster, 2017/02/27
- [Qemu-block] [PATCH 10/24] qjson: Abort earlier on qobject_from_jsonf() misuse, Markus Armbruster, 2017/02/27
- [Qemu-block] [PATCH 09/24] libqtest: Fix qmp() & friends to abort on JSON parse errors, Markus Armbruster, 2017/02/27
- [Qemu-block] [PATCH 01/24] test-qemu-opts: Cover qemu_opts_parse() of "no",
Markus Armbruster <=
- [Qemu-block] [PATCH 18/24] block: Initial implementation of -blockdev, Markus Armbruster, 2017/02/27
- [Qemu-block] [PATCH 05/24] test-keyval: Cover use with qobject input visitor, Markus Armbruster, 2017/02/27
- [Qemu-block] [PATCH 03/24] keyval: New keyval_parse(), Markus Armbruster, 2017/02/27