| 2253 | |
| 2254 | template <typename TYPE> |
| 2255 | void CheckFloatApproxEqualsWithAtol() { |
| 2256 | using c_type = typename TYPE::c_type; |
| 2257 | auto type = TypeTraits<TYPE>::type_singleton(); |
| 2258 | std::shared_ptr<Array> a, b; |
| 2259 | ArrayFromVector<TYPE>(type, {true}, {static_cast<c_type>(0.5)}, &a); |
| 2260 | ArrayFromVector<TYPE>(type, {true}, {static_cast<c_type>(0.6)}, &b); |
| 2261 | auto options = EqualOptions::Defaults().atol(0.2); |
| 2262 | |
| 2263 | ASSERT_FALSE(a->Equals(b)); |
| 2264 | ASSERT_TRUE(a->Equals(b, options)); |
| 2265 | ARROW_SUPPRESS_DEPRECATION_WARNING |
| 2266 | ASSERT_TRUE(a->Equals(b, options.use_atol(true))); |
| 2267 | ASSERT_FALSE(a->Equals(b, options.use_atol(false))); |
| 2268 | ARROW_UNSUPPRESS_DEPRECATION_WARNING |
| 2269 | ASSERT_TRUE(a->ApproxEquals(b, options)); |
| 2270 | |
| 2271 | ASSERT_FALSE(a->RangeEquals(0, 1, 0, b)); |
| 2272 | ASSERT_TRUE(a->RangeEquals(0, 1, 0, b, options)); |
| 2273 | ARROW_SUPPRESS_DEPRECATION_WARNING |
| 2274 | ASSERT_TRUE(a->RangeEquals(0, 1, 0, b, options.use_atol(true))); |
| 2275 | ASSERT_FALSE(a->RangeEquals(0, 1, 0, b, options.use_atol(false))); |
| 2276 | ARROW_UNSUPPRESS_DEPRECATION_WARNING |
| 2277 | ASSERT_TRUE(ArrayRangeApproxEquals(*a, *b, 0, 1, 0, options)); |
| 2278 | } |
| 2279 | |
| 2280 | template <typename TYPE> |
| 2281 | void CheckSliceApproxEquals() { |
nothing calls this directly
no test coverage detected