[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 6/8] qapi: add native list coverage for visitor
From: |
Laszlo Ersek |
Subject: |
Re: [Qemu-devel] [PATCH 6/8] qapi: add native list coverage for visitor serialization tests |
Date: |
Thu, 09 May 2013 14:31:03 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 |
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.
> + 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.
(Same holds for the original instance of this code, test_primitives().)
> + g_free(double1);
> + g_free(double2);
> + break;
> + }
Thanks,
Laszlo
- [Qemu-devel] [PATCH 0/8] qapi: add support for lists of native types, Michael Roth, 2013/05/08
- [Qemu-devel] [PATCH 1/8] qapi: qapi-types.py, native list support, Michael Roth, 2013/05/08
- [Qemu-devel] [PATCH 2/8] qapi: qapi-visit.py, fix list handling for union types, Michael Roth, 2013/05/08
- [Qemu-devel] [PATCH 3/8] qapi: qapi-visit.py, native list support, Michael Roth, 2013/05/08
- [Qemu-devel] [PATCH 4/8] qapi: enable generation of native list code, Michael Roth, 2013/05/08
- [Qemu-devel] [PATCH 5/8] qapi: fix leak in unit tests, Michael Roth, 2013/05/08
- [Qemu-devel] [PATCH 6/8] qapi: add native list coverage for visitor serialization tests, Michael Roth, 2013/05/08
- Re: [Qemu-devel] [PATCH 6/8] qapi: add native list coverage for visitor serialization tests,
Laszlo Ersek <=
- [Qemu-devel] [PATCH 7/8] qapi: add native list coverage for QMP output visitor tests, Michael Roth, 2013/05/08
- [Qemu-devel] [PATCH 8/8] qapi: add native list coverage for QMP input visitor tests, Michael Roth, 2013/05/08
- Re: [Qemu-devel] [PATCH 0/8] qapi: add support for lists of native types, Laszlo Ersek, 2013/05/09