[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 10/36] test-qemu-opts: Test qemu_opts_to_qdic
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v2 10/36] test-qemu-opts: Test qemu_opts_to_qdict_filtered() |
Date: |
Thu, 22 Feb 2018 10:50:42 +0100 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
Am 21.02.2018 um 21:57 hat Eric Blake geschrieben:
> On 02/21/2018 07:53 AM, Kevin Wolf wrote:
> > Signed-off-by: Kevin Wolf <address@hidden>
> > ---
> > tests/test-qemu-opts.c | 125
> > +++++++++++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 125 insertions(+)
> >
> > diff --git a/tests/test-qemu-opts.c b/tests/test-qemu-opts.c
> > index 6c3183390b..2c422abcd4 100644
> > --- a/tests/test-qemu-opts.c
> > +++ b/tests/test-qemu-opts.c
> > @@ -10,6 +10,7 @@
> > #include "qemu/osdep.h"
> > #include "qemu/cutils.h"
> > #include "qemu/option.h"
> > +#include "qemu/option_int.h"
> > #include "qapi/error.h"
> > #include "qapi/qmp/qdict.h"
> > #include "qapi/qmp/qstring.h"
> > @@ -868,6 +869,127 @@ static void test_opts_append(void)
> > qemu_opts_free(merged);
> > }
> > +static void test_opts_to_qdict_basic(void)
> > +{
> > + QemuOpts *opts;
> > + QDict *dict;
> > +
> > + opts = qemu_opts_parse(&opts_list_01,
> > "str1=foo,str2=,str3=bar,number1=42",
> > + false, &error_abort);
>
> Worth any additional craziness in regards to our QemuOpts parsing, like
> str1=foo,,bar,str2... for an option containing commas, or str2=,str1=foo,
> for supplying options in a different order than the list? But what you have
> is a good addition even if you don't tweak it.
This is not a test for parsing options string, but for converting an
already existing QemuOpts to a QDict. Parsing is already extensively
tested in /qemu-opts/opts_parse/*. I'm only using qemu_opts_parse() here
because it's the most convenient way to create a QemuOpts with multiple
options.
So the only things we need to consider in this test case are different
QemuOpts that result from the parsing. Escaped commas don't exist in
this representation any more and the associated QemuOptsList isn't
involved in the conversion to QDicts, so these wouldn't actually be new
cases for the thing we're testing here.
Kevin
- [Qemu-devel] [PATCH v2 07/36] qcow2: Handle full/falloc preallocation in qcow2_create2(), (continued)
- [Qemu-devel] [PATCH v2 07/36] qcow2: Handle full/falloc preallocation in qcow2_create2(), Kevin Wolf, 2018/02/21
- [Qemu-devel] [PATCH v2 06/36] qcow2: Use QCryptoBlockCreateOptions in qcow2_create2(), Kevin Wolf, 2018/02/21
- [Qemu-devel] [PATCH v2 08/36] util: Add qemu_opts_to_qdict_filtered(), Kevin Wolf, 2018/02/21
- [Qemu-devel] [PATCH v2 09/36] test-qemu-opts: Test qemu_opts_append(), Kevin Wolf, 2018/02/21
- [Qemu-devel] [PATCH v2 10/36] test-qemu-opts: Test qemu_opts_to_qdict_filtered(), Kevin Wolf, 2018/02/21
- Re: [Qemu-devel] [PATCH v2 10/36] test-qemu-opts: Test qemu_opts_to_qdict_filtered(), Max Reitz, 2018/02/22
- [Qemu-devel] [PATCH v2 11/36] qdict: Introduce qdict_rename_keys(), Kevin Wolf, 2018/02/21
- [Qemu-devel] [PATCH v2 13/36] block: Make bdrv_is_whitelisted() public, Kevin Wolf, 2018/02/21
- [Qemu-devel] [PATCH v2 12/36] qcow2: Use visitor for options in qcow2_create(), Kevin Wolf, 2018/02/21
- [Qemu-devel] [PATCH v2 14/36] block: x-blockdev-create QMP command, Kevin Wolf, 2018/02/21