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

Function TEST

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

Source from the content-addressed store, hash-verified

180}
181
182TEST(AssertTestWithinUlp, Basics) {
183 AssertWithinUlp(123.4567, 123.45670000000015, 11);
184 AssertWithinUlp(123.456f, 123.456085f, 11);
185 AssertWithinUlp(Float16(123.456f), Float16(124.143501f), 11);
186 AssertWithinUlp(std::numeric_limits<float>::quiet_NaN(),
187 std::numeric_limits<float>::quiet_NaN(), 2);
188 AssertWithinUlp(std::numeric_limits<double>::quiet_NaN(),
189 std::numeric_limits<double>::quiet_NaN(), 2);
190 AssertWithinUlp(std::numeric_limits<Float16>::quiet_NaN(),
191 std::numeric_limits<Float16>::quiet_NaN(), 2);
192#ifndef _WIN32
193 // GH-47442
194 EXPECT_FATAL_FAILURE(AssertWithinUlp(123.4567, 123.45670000000015, 10),
195 "not within 10 ulps");
196 EXPECT_FATAL_FAILURE(AssertWithinUlp(123.456f, 123.456085f, 10), "not within 10 ulps");
197 EXPECT_FATAL_FAILURE(AssertWithinUlp(Float16(123.456f), Float16(124.143501f), 10),
198 "not within 10 ulps");
199#endif
200}
201
202} // namespace arrow::util

Callers

nothing calls this directly

Calls 2

AssertWithinUlpFunction · 0.85
Float16Function · 0.50

Tested by

no test coverage detected