This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/7] Allow more Python scalar conversions
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