qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/2] tests: Expose regression in QemuOpts visito


From: Michael Roth
Subject: Re: [Qemu-devel] [PATCH 1/2] tests: Expose regression in QemuOpts visitor
Date: Mon, 20 Mar 2017 23:41:17 -0500
User-agent: alot/0.3.6

Quoting Eric Blake (2017-03-20 22:17:04)
> Commit 15c2f669e broke the ability of the QemuOpts visitor to
> flag extra input parameters, but the regression went unnoticed
> because of missing testsuite coverage.  Add a test to cover this.
> 
> Signed-off-by: Eric Blake <address@hidden>

Reviewed-by: Michael Roth <address@hidden>

> ---
>  tests/test-opts-visitor.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/tests/test-opts-visitor.c b/tests/test-opts-visitor.c
> index 2238f8e..a47c344 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);
> +    /* FIXME: 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;
>  }
> -- 
> 2.9.3
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]