mirror of
https://gitlab.com/qemu-project/qemu.git
synced 2024-12-02 18:42:58 +03:00
tests/check-qnum: Cover qnum_to_string() for "unround" argument
qnum_to_string() has a FIXME comment about rounding errors due to insufficient precision. Cover it: 2.718281828459045 gets converted to "2.718282". The next commit will fix it. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20201210161452.2813491-6-armbru@redhat.com>
This commit is contained in:
parent
780df5d42b
commit
1a9076919f
@ -150,6 +150,12 @@ static void qnum_to_string_test(void)
|
||||
g_assert_cmpstr(tmp, ==, "0.42");
|
||||
g_free(tmp);
|
||||
qobject_unref(qn);
|
||||
|
||||
qn = qnum_from_double(2.718281828459045);
|
||||
tmp = qnum_to_string(qn);
|
||||
g_assert_cmpstr(tmp, ==, "2.718282"); /* BUG */
|
||||
g_free(tmp);
|
||||
qobject_unref(qn);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
|
Loading…
Reference in New Issue
Block a user