Smoke test for std::round and std::lround

Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
Alexander Borsuk
2025-07-15 00:48:19 +03:00
committed by Konstantin Pastbin
parent 972cefb074
commit ae349462c6

View File

@@ -45,6 +45,19 @@ void TestMaxULPs()
} }
} // namespace } // namespace
UNIT_TEST(round_lround_smoke)
{
TEST_EQUAL(std::round(0.4), 0.0, ());
TEST_EQUAL(std::round(0.6), 1.0, ());
TEST_EQUAL(std::round(-0.4), 0.0, ());
TEST_EQUAL(std::round(-0.6), -1.0, ());
TEST_EQUAL(std::lround(0.4), 0l, ());
TEST_EQUAL(std::lround(0.6), 1l, ());
TEST_EQUAL(std::lround(-0.4), 0l, ());
TEST_EQUAL(std::lround(-0.6), -1l, ());
}
UNIT_TEST(PowUInt) UNIT_TEST(PowUInt)
{ {
TEST_EQUAL(PowUint(3, 10), 59049, ()); TEST_EQUAL(PowUint(3, 10), 59049, ());