pitrou commented on code in PR #36769:
URL: https://github.com/apache/arrow/pull/36769#discussion_r1267791880
##########
cpp/src/arrow/util/decimal_test.cc:
##########
@@ -1046,42 +1046,51 @@ using ToDoubleTestParam = ToRealTestParam<double>;
template <typename Decimal, typename Real>
void CheckDecimalToReal(const std::string& decimal_value, int32_t scale, Real
expected) {
Decimal dec(decimal_value);
- ASSERT_EQ(dec.template ToReal<Real>(scale), expected)
- << "Decimal value: " << decimal_value << " Scale: " << scale;
+ Real actual = dec.template ToReal<Real>(scale);
Review Comment:
I wonder if that's necessary. Introducing a deliberate error seems to
display the values with sufficient precision:
```
[ RUN ] TestDecimalToRealFloat/0.Precision
/arrow/cpp/src/arrow/util/decimal_test.cc:1071: Failure
Value of: std::abs(actual - expected) <= epsilon
Actual: false
Expected: true
Decimal value: 1.987748987892758765582589910934859345, scale: 36, expected:
1.9877489805221558, actual: 1.9877490997314453
[ FAILED ] TestDecimalToRealFloat/0.Precision, where TypeParam =
arrow::Decimal128 (0 ms)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]