From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60579) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaPxq-0001Un-7M for qemu-devel@nongnu.org; Thu, 09 May 2013 08:28:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UaPxn-0007b6-4r for qemu-devel@nongnu.org; Thu, 09 May 2013 08:28:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5606) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaPxm-0007Zw-Sj for qemu-devel@nongnu.org; Thu, 09 May 2013 08:28:47 -0400 Message-ID: <518B9707.2050809@redhat.com> Date: Thu, 09 May 2013 14:31:03 +0200 From: Laszlo Ersek MIME-Version: 1.0 References: <1368056037-16350-1-git-send-email-mdroth@linux.vnet.ibm.com> <1368056037-16350-7-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1368056037-16350-7-git-send-email-mdroth@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 6/8] qapi: add native list coverage for visitor serialization tests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: akong@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com 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