qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Hu Tao <hutao@cn.fujitsu.com>, qemu-devel@nongnu.org
Cc: Yasunori Goto <y-goto@jp.fujitsu.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 3/3] tests: add human format test for string output visitor
Date: Fri, 20 Jun 2014 09:40:31 -0600	[thread overview]
Message-ID: <53A455EF.8050308@redhat.com> (raw)
In-Reply-To: <61b0b2f7ec170edcbe9dd45d6f098ae50c1178f9.1403243169.git.hutao@cn.fujitsu.com>

[-- Attachment #1: Type: text/plain, Size: 1100 bytes --]

On 06/19/2014 11:55 PM, Hu Tao wrote:
> Signed-off-by: Hu Tao <hutao@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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2014-06-20 15:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-20  5:55 [Qemu-devel] [PATCH 0/3] another round of pci fixes Hu Tao
2014-06-20  5:55 ` [Qemu-devel] [PATCH 1/3] fixup! libqemustub: add more stubs for qemu-char Hu Tao
2014-06-20  6:03   ` Nikolay Nikolaev
2014-06-20  6:17     ` Hu Tao
2014-06-20  6:31   ` [Qemu-devel] [PATCH v2] " Hu Tao
2014-06-20  8:26   ` [Qemu-devel] [PATCH 1/3] " Peter Maydell
2014-06-20  8:29     ` Hu Tao
2014-06-20  5:55 ` [Qemu-devel] [PATCH 2/3] fixup! qapi/string-output-visitor: fix bugs Hu Tao
2014-06-20 15:34   ` Eric Blake
2014-06-20  5:55 ` [Qemu-devel] [PATCH 3/3] tests: add human format test for string output visitor Hu Tao
2014-06-20 15:40   ` Eric Blake [this message]
2014-06-22 10:11     ` Michael S. Tsirkin
2014-06-22  7:19 ` [Qemu-devel] [PATCH 0/3] another round of pci fixes Michael S. Tsirkin
2014-06-29 15:23 ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53A455EF.8050308@redhat.com \
    --to=eblake@redhat.com \
    --cc=hutao@cn.fujitsu.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=y-goto@jp.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).