From nobody Tue Feb 10 02:49:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1607628096; cv=none; d=zohomail.com; s=zohoarc; b=KkY/Itduv2dvtG+epMyFbndFYpO3nThTjK9VkEyIlkznp7ihoUeo5RUSQcjwxZ9w5hzo4EMXLB95TMd0x03WCoWQ9wfYZbgbMuE4wVh9ZVclQGLc601c3Wpvr6XmjfUlNPi0gwso2xtbmDk0gLHlLyyJeIJMtRYP5x2xdsQfntI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607628096; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oUqJFE9jin09mkoOn0Y6n1qgPYa13jp2O4WdhQnTYn4=; b=KtkAfHQOJKeUWUT1S1BDREcpIZMlo+L7sg/mswBPGBAMgz+efwjwhrkM9HvOHTNKCchwPxqTAqXl5WQoRuDMK0YXLgAIWWSPhWgM+tPvy8XLV3OwKE0PjObwn8JOvgruknpCtUVIPJ3HMVz1caRSUHNYIkfuubCQebpX4uVuHdg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1607628096285742.5649808516266; Thu, 10 Dec 2020 11:21:36 -0800 (PST) Received: from localhost ([::1]:43442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knOft-0007au-99 for importer@patchew.org; Thu, 10 Dec 2020 11:20:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knOb7-0004wj-UR for qemu-devel@nongnu.org; Thu, 10 Dec 2020 11:15:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:52658) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1knOaq-00015m-Hz for qemu-devel@nongnu.org; Thu, 10 Dec 2020 11:15:17 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-115-TgScM_y6OwGs8cYpeOYezA-1; Thu, 10 Dec 2020 11:14:56 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BF6E4809DD2; Thu, 10 Dec 2020 16:14:55 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-103.ams2.redhat.com [10.36.112.103]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8E72260BF3; Thu, 10 Dec 2020 16:14:55 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8871910FA0A9; Thu, 10 Dec 2020 17:14:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607616898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oUqJFE9jin09mkoOn0Y6n1qgPYa13jp2O4WdhQnTYn4=; b=MEt1u+0tV7kmRO5FqBryvqo9RUkCa7Qo2BZE/eQZs3fNvpmDZdpyVBMLTzUI8KGRqG4fCX kSo+RLxFBtmwavAOl+4vzJ/dPs0JvODQPMF02z/PTJMv4qqDvR5x0ujqtk7VhGZ9a3PRlp sD02TdR+qf4qUCYiqa87OJTtAbcINHc= X-MC-Unique: TgScM_y6OwGs8cYpeOYezA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH 07/10] test-string-output-visitor: Cover "unround" number Date: Thu, 10 Dec 2020 17:14:49 +0100 Message-Id: <20201210161452.2813491-8-armbru@redhat.com> In-Reply-To: <20201210161452.2813491-1-armbru@redhat.com> References: <20201210161452.2813491-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mdroth@linux.vnet.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This demonstrates rounding error due to insufficient precision: double 3.1415926535897932 gets converted to JSON 3.141593. Signed-off-by: Markus Armbruster --- tests/test-string-output-visitor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test-string-output-visitor.c b/tests/test-string-output-= visitor.c index 9f6581439a..cec20848ea 100644 --- a/tests/test-string-output-visitor.c +++ b/tests/test-string-output-visitor.c @@ -130,13 +130,13 @@ static void test_visitor_out_bool(TestOutputVisitorDa= ta *data, static void test_visitor_out_number(TestOutputVisitorData *data, const void *unused) { - double value =3D 3.14; + double value =3D 3.1415926535897932; char *str; =20 visit_type_number(data->ov, NULL, &value, &error_abort); =20 str =3D visitor_get(data); - g_assert_cmpstr(str, =3D=3D, "3.140000"); + g_assert_cmpstr(str, =3D=3D, "3.141593"); } =20 static void test_visitor_out_string(TestOutputVisitorData *data, --=20 2.26.2