From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 67772 invoked by alias); 24 Sep 2018 02:06:31 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 66093 invoked by uid 89); 24 Sep 2018 02:06:23 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=2018-09-15, 20180915, 2.3, Python X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 24 Sep 2018 02:06:21 +0000 Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id E6C021E519; Sun, 23 Sep 2018 22:06:18 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=simark.ca; s=mail; t=1537754779; bh=UuxlAXAiHtHIkxZ8IymFHTMhMO4i0Vs8P71qBxp7Vc4=; h=Subject:To:References:From:Date:In-Reply-To:From; b=bRaQ1ryjl36c13Nc1UCaFVRdy4SC/10V7wH+3CFp8ltGjxCSHU3EL5h8WD4X6Uk4Y jB0htVcuktkeh1rmAs4DW7NZZOAAm+EdATKP68+oM3bCO30Vlo+vr5slbj3p1JhDS9 +hDCHa3CApTQoc1CyPLBuIUfHTDb+14aeXetR5pE= Subject: Re: [PATCH 1/7] Allow more Python scalar conversions To: Tom Tromey , gdb-patches@sourceware.org References: <20180915072459.14934-1-tom@tromey.com> <20180915072459.14934-2-tom@tromey.com> From: Simon Marchi Message-ID: <3e15a979-8e98-578a-542c-6318efb8c579@simark.ca> Date: Mon, 24 Sep 2018 02:06:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20180915072459.14934-2-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-09/txt/msg00792.txt.bz2 On 2018-09-15 3:24 a.m., Tom Tromey wrote: > +proc test_float_conversion {} { > + gdb_test "python print int(gdb.Value(0))" "0" > + gdb_test "python print int(gdb.Value(0.0))" "0" > + gdb_test "python print long(gdb.Value(0))" "0" > + gdb_test "python print long(gdb.Value(0.0))" "0" > + gdb_test "python print float(gdb.Value(0.0))" "0\\.0" > + gdb_test "python print float(gdb.Value(0))" "0\\.0" > +} This LGTM, but I just wanted to mention that I would probably have tested with another value than 0. For example, test that the truncation (int(2.3) which becomes 2) works correctly. Not really a big deal. Simon