qemu-devel
[Top][All Lists]
Advanced

[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: mdroth
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
User-agent: Mutt/1.5.21 (2010-09-15)

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
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]