From: mdroth <mdroth@linux.vnet.ibm.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: akong@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCH 6/8] qapi: add native list coverage for visitor serialization tests
Date: Thu, 9 May 2013 08:32:57 -0500 [thread overview]
Message-ID: <20130509133257.GA13213@vm> (raw)
In-Reply-To: <518B9707.2050809@redhat.com>
On Thu, May 09, 2013 at 02:31:03PM +0200, Laszlo Ersek wrote:
> On 05/09/13 01:33, Michael Roth wrote:
>
> > + case PTYPE_NUMBER: {
> > + numberList *ptr;
> > + char *double1, *double2;
> > + if (cur_head) {
> > + ptr = cur_head;
> > + cur_head = ptr->next;
> > + } else {
> > + cur_head = ptr = pl_copy.value.numbers;
> > + }
> > + /* we serialize with %f for our reference visitors, so rather than
> > + * fuzzy * floating math to test "equality", just compare the
> > + * formatted values
> > + */
>
> I think this comment block has been copied from elsewhere in this file,
> indented more deeply and re-filled. There's an asterisk in the comment
> body now.
Yes :) Will fix it on the next pass.
>
>
> > + double1 = g_malloc0(calc_float_string_storage(pt->value.number));
> > + double2 = g_malloc0(calc_float_string_storage(ptr->value));
> > + g_assert_cmpstr(double1, ==, double2);
>
> Are you comparing empty strings? Space is allocated and zeroed, but I
> can't see where the values are actually formatted.
Well, that's embarassing...
>
> (Same holds for the original instance of this code, test_primitives().)
>
but at least I can blame it on the fact that I copied it from here
(we'll just ignore who the original author was :)
Will add a patch on the next pass to fix the original instance
beforehand.
Thanks for the catch!
> > + g_free(double1);
> > + g_free(double2);
> > + break;
> > + }
>
> Thanks,
> Laszlo
>
next prev parent reply other threads:[~2013-05-09 13:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-08 23:33 [Qemu-devel] [PATCH 0/8] qapi: add support for lists of native types Michael Roth
2013-05-08 23:33 ` [Qemu-devel] [PATCH 1/8] qapi: qapi-types.py, native list support Michael Roth
2013-05-08 23:33 ` [Qemu-devel] [PATCH 2/8] qapi: qapi-visit.py, fix list handling for union types Michael Roth
2013-05-08 23:33 ` [Qemu-devel] [PATCH 3/8] qapi: qapi-visit.py, native list support Michael Roth
2013-05-08 23:33 ` [Qemu-devel] [PATCH 4/8] qapi: enable generation of native list code Michael Roth
2013-05-08 23:33 ` [Qemu-devel] [PATCH 5/8] qapi: fix leak in unit tests Michael Roth
2013-05-08 23:33 ` [Qemu-devel] [PATCH 6/8] qapi: add native list coverage for visitor serialization tests Michael Roth
2013-05-09 12:31 ` Laszlo Ersek
2013-05-09 13:32 ` mdroth [this message]
2013-05-08 23:33 ` [Qemu-devel] [PATCH 7/8] qapi: add native list coverage for QMP output visitor tests Michael Roth
2013-05-08 23:33 ` [Qemu-devel] [PATCH 8/8] qapi: add native list coverage for QMP input " Michael Roth
2013-05-09 13:31 ` [Qemu-devel] [PATCH 0/8] qapi: add support for lists of native types Laszlo Ersek
2013-05-09 13:49 ` mdroth
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=20130509133257.GA13213@vm \
--to=mdroth@linux.vnet.ibm.com \
--cc=akong@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=lersek@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.