| 2191 | |
| 2192 | template <typename TYPE> |
| 2193 | void CheckFloatApproxEqualsWithAtol() { |
| 2194 | using c_type = typename TYPE::c_type; |
| 2195 | auto type = TypeTraits<TYPE>::type_singleton(); |
| 2196 | std::shared_ptr<Array> a, b; |
| 2197 | ArrayFromVector<TYPE>(type, {true}, {static_cast<c_type>(0.5)}, &a); |
| 2198 | ArrayFromVector<TYPE>(type, {true}, {static_cast<c_type>(0.6)}, &b); |
| 2199 | auto options = EqualOptions::Defaults().atol(0.2); |
| 2200 | |
| 2201 | ASSERT_FALSE(a->Equals(b)); |
| 2202 | ASSERT_TRUE(a->Equals(b, options.use_atol(true))); |
| 2203 | ASSERT_TRUE(a->ApproxEquals(b, options)); |
| 2204 | |
| 2205 | ASSERT_FALSE(a->RangeEquals(0, 1, 0, b, options)); |
| 2206 | ASSERT_TRUE(a->RangeEquals(0, 1, 0, b, options.use_atol(true))); |
| 2207 | ASSERT_TRUE(ArrayRangeApproxEquals(*a, *b, 0, 1, 0, options)); |
| 2208 | } |
| 2209 | |
| 2210 | template <typename TYPE> |
| 2211 | void CheckSliceApproxEquals() { |
nothing calls this directly
no test coverage detected