MCPcopy Create free account
hub / github.com/boostorg/json / TEST

Function TEST

test/ryu/d2s_test.cpp:52–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52TEST(D2sTest, Basic) {
53 std::array<char, 25> buffer;
54 ASSERT_STREQ("0E0", d2s_test_helper(buffer.data(), 0.0));
55 ASSERT_STREQ("-0E0", d2s_test_helper(buffer.data(), -0.0));
56 ASSERT_STREQ("1E0", d2s_test_helper(buffer.data(), 1.0));
57 ASSERT_STREQ("-1E0", d2s_test_helper(buffer.data(), -1.0));
58 ASSERT_STREQ(
59 "NaN",
60 d2s_test_helper(buffer.data(), std::numeric_limits<float>::quiet_NaN()));
61 using Limits = std::numeric_limits<double>;
62 ASSERT_STREQ(
63 "Infinity", d2s_test_helper(buffer.data(), Limits::infinity()));
64 ASSERT_STREQ(
65 "-Infinity", d2s_test_helper(buffer.data(), -Limits::infinity()));
66}
67
68TEST(D2sTest, SwitchToSubnormal) {
69 std::array<char, 25> buffer;

Callers

nothing calls this directly

Calls 4

d2s_test_helperFunction · 0.85
int64Bits2DoubleFunction · 0.85
ieeeParts2DoubleFunction · 0.85
dataMethod · 0.45

Tested by

no test coverage detected