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

Function TEST

cpp/src/arrow/testing/gtest_util_test.cc:199–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199TEST(AssertTestWithinUlp, Basics) {
200 AssertWithinUlp(123.4567, 123.45670000000015, 11);
201 AssertWithinUlp(123.456f, 123.456085f, 11);
202 AssertWithinUlp(Float16(123.456f), Float16(124.143501f), 11);
203 AssertWithinUlp(std::numeric_limits<float>::quiet_NaN(),
204 std::numeric_limits<float>::quiet_NaN(), 2);
205 AssertWithinUlp(std::numeric_limits<double>::quiet_NaN(),
206 std::numeric_limits<double>::quiet_NaN(), 2);
207 AssertWithinUlp(std::numeric_limits<Float16>::quiet_NaN(),
208 std::numeric_limits<Float16>::quiet_NaN(), 2);
209#ifndef _WIN32
210 // GH-47442
211 EXPECT_FATAL_FAILURE(AssertWithinUlp(123.4567, 123.45670000000015, 10),
212 "not within 10 ulps");
213 EXPECT_FATAL_FAILURE(AssertWithinUlp(123.456f, 123.456085f, 10), "not within 10 ulps");
214 EXPECT_FATAL_FAILURE(AssertWithinUlp(Float16(123.456f), Float16(124.143501f), 10),
215 "not within 10 ulps");
216#endif
217}
218
219} // namespace arrow::util

Callers

nothing calls this directly

Calls 2

AssertWithinUlpFunction · 0.85
Float16Function · 0.50

Tested by

no test coverage detected