From 69bd245b71f8d09c26080bd1eb20fbfa0258a72c Mon Sep 17 00:00:00 2001 From: Florin Iucha Date: Sun, 1 Dec 2019 13:01:09 -0500 Subject: [PATCH] fixup! Clean-up sign-conversion warnings in test code --- test/format-impl-test.cc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/test/format-impl-test.cc b/test/format-impl-test.cc index 89ba25c1..bf377699 100644 --- a/test/format-impl-test.cc +++ b/test/format-impl-test.cc @@ -224,23 +224,19 @@ TEST(FPTest, Normalize) { } TEST(FPTest, ComputeFloatBoundaries) { - /* - * TODO: investigate why changing type of x to 'float' and removing the - * static casts causes the test to fail. - */ struct { double x, lower, upper; } tests[] = { // regular - {static_cast(1.5f), 1.4999999403953552, 1.5000000596046448}, + {1.5f, 1.4999999403953552, 1.5000000596046448}, // boundary - {static_cast(1.0f), 0.9999999701976776, 1.0000000596046448}, + {1.0f, 0.9999999701976776, 1.0000000596046448}, // min normal - {static_cast(1.1754944e-38f), 1.1754942807573643e-38, 1.1754944208872107e-38}, + {1.1754944e-38f, 1.1754942807573643e-38, 1.1754944208872107e-38}, // max subnormal - {static_cast(1.1754942e-38f), 1.1754941406275179e-38, 1.1754942807573643e-38}, + {1.1754942e-38f, 1.1754941406275179e-38, 1.1754942807573643e-38}, // min subnormal - {static_cast(1e-45f), 7.006492321624085e-46, 2.1019476964872256e-45}, + {1e-45f, 7.006492321624085e-46, 2.1019476964872256e-45}, }; for (auto test : tests) { fp vlower = normalize(fp(test.lower));