From: "Michael S. Tsirkin" <mst@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Hu Tao <hutao@cn.fujitsu.com>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org, Yasunori Goto <y-goto@jp.fujitsu.com>
Subject: Re: [Qemu-devel] [PATCH 3/3] tests: add human format test for string output visitor
Date: Sun, 22 Jun 2014 13:11:34 +0300 [thread overview]
Message-ID: <20140622101134.GA17067@redhat.com> (raw)
In-Reply-To: <53A455EF.8050308@redhat.com>
On Fri, Jun 20, 2014 at 09:40:31AM -0600, Eric Blake wrote:
> 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.
We have different styles really, coding style does not say.
And that line's was way too long, so it did need a split.
> --
> Eric Blake eblake redhat com +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>
next prev parent reply other threads:[~2014-06-22 10:11 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
2014-06-22 10:11 ` Michael S. Tsirkin [this message]
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=20140622101134.GA17067@redhat.com \
--to=mst@redhat.com \
--cc=eblake@redhat.com \
--cc=hutao@cn.fujitsu.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).