On 06/19/2014 11:55 PM, Hu Tao wrote:
> Signed-off-by: Hu Tao <hu...@cn.fujitsu.com>
> ---
>  tests/test-string-output-visitor.c | 109 
> ++++++++++++++++++++++++++++++-------
>  1 file changed, 90 insertions(+), 19 deletions(-)
> 

>  
> +        len = strlen(EnumOne_lookup[i]) + 2;
> +        str_human = g_malloc0(len);
> +        str_human[0] = '"';
> +        strncpy(str_human + 1, EnumOne_lookup[i], strlen(EnumOne_lookup[i]));
> +        str_human[len - 1] = '"';

Eww.  Just use g_strdup_printf("\"%s\"", EnumOne_lookup[i]), instead of
futzing around with manual length calculations.


>  
> -static void output_visitor_test_add(const char *testpath,
> -                                    TestOutputVisitorData *data,
> -                                    void (*test_func)(TestOutputVisitorData 
> *data, const void *user_data))
> +static void
> +output_visitor_test_add(const char *testpath,

Why the line split? You moved away from the usual qemu style.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to