MCPcopy Create free account
hub / github.com/apache/fory / TEST

Function TEST

cpp/fory/util/float16_test.cc:90–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90TEST(Float16FromFloatTest, HandlesSignedZerosAndInfinities) {
91 const uint16_t positive_zero = convert_bits(0.0f);
92 const uint16_t negative_zero = convert_bits(-0.0f);
93 EXPECT_HALF_EQ(positive_zero, 0x0000);
94 EXPECT_HALF_EQ(negative_zero, 0x8000);
95 EXPECT_HALF_EQ(static_cast<uint16_t>(positive_zero & 0x7FFF), 0x0000);
96 EXPECT_HALF_EQ(static_cast<uint16_t>(negative_zero & 0x7FFF), 0x0000);
97
98 EXPECT_HALF_EQ(convert_bits(std::numeric_limits<float>::infinity()), 0x7C00);
99 EXPECT_HALF_EQ(convert_bits(-std::numeric_limits<float>::infinity()), 0xFC00);
100}
101
102TEST(Float16FromFloatTest, PreservesNaNPayloadAndQuietsSignalingNaNs) {
103 struct Case {

Callers

nothing calls this directly

Calls 15

convert_bitsFunction · 0.85
bits_to_floatFunction · 0.85
ExpectSignSymmetryFunction · 0.85
half_bits_to_doubleFunction · 0.85
float_to_bitsFunction · 0.85
HFunction · 0.85
add_bitsFunction · 0.85
sub_bitsFunction · 0.85
mul_bitsFunction · 0.85
div_bitsFunction · 0.85
allocate_bufferFunction · 0.85
make_xlang_foryFunction · 0.85

Tested by

no test coverage detected