summaryrefslogtreecommitdiffstats
path: root/tests/unit/test-cutils.c
diff options
context:
space:
mode:
authorPeter Maydell2021-03-16 22:08:07 +0100
committerPeter Maydell2021-03-16 22:08:07 +0100
commit0693602a23276b076a679b1e7ed9125a444336b6 (patch)
tree92abe05dedd247630a82e526bd28098873929736 /tests/unit/test-cutils.c
parentMerge remote-tracking branch 'remotes/kraxel/tags/usb-20210315-pull-request' ... (diff)
parentutils: Use fixed-point arithmetic in qemu_strtosz (diff)
downloadqemu-0693602a23276b076a679b1e7ed9125a444336b6.tar.gz
qemu-0693602a23276b076a679b1e7ed9125a444336b6.tar.xz
qemu-0693602a23276b076a679b1e7ed9125a444336b6.zip
Merge remote-tracking branch 'remotes/rth-gitlab/tags/pull-misc-20210315' into staging
Fix qemu_strtosz testsuite failures for i686. # gpg: Signature made Mon 15 Mar 2021 18:49:12 GMT # gpg: using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F # gpg: issuer "richard.henderson@linaro.org" # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full] # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A 05C0 64DF 38E8 AF7E 215F * remotes/rth-gitlab/tags/pull-misc-20210315: utils: Use fixed-point arithmetic in qemu_strtosz Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests/unit/test-cutils.c')
-rw-r--r--tests/unit/test-cutils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/unit/test-cutils.c b/tests/unit/test-cutils.c
index bad3a60993..e025b54c05 100644
--- a/tests/unit/test-cutils.c
+++ b/tests/unit/test-cutils.c
@@ -2128,7 +2128,7 @@ static void test_qemu_strtosz_float(void)
str = "12.345M";
err = qemu_strtosz(str, &endptr, &res);
g_assert_cmpint(err, ==, 0);
- g_assert_cmpint(res, ==, (uint64_t) (12.345 * MiB));
+ g_assert_cmpint(res, ==, (uint64_t) (12.345 * MiB + 0.5));
g_assert(endptr == str + 7);
}