| 47 | }; |
| 48 | |
| 49 | std::vector<Decimal128> TestDecimal::MakeDecimalVector(std::vector<std::string> values, |
| 50 | int32_t scale) { |
| 51 | std::vector<arrow::Decimal128> ret; |
| 52 | for (auto str : values) { |
| 53 | Decimal128 str_value; |
| 54 | int32_t str_precision; |
| 55 | int32_t str_scale; |
| 56 | |
| 57 | DCHECK_OK(Decimal128::FromString(str, &str_value, &str_precision, &str_scale)); |
| 58 | |
| 59 | Decimal128 scaled_value; |
| 60 | if (str_scale == scale) { |
| 61 | scaled_value = str_value; |
| 62 | } else { |
| 63 | scaled_value = str_value.Rescale(str_scale, scale).ValueOrDie(); |
| 64 | } |
| 65 | ret.push_back(scaled_value); |
| 66 | } |
| 67 | return ret; |
| 68 | } |
| 69 | |
| 70 | TEST_F(TestDecimal, TestSimple) { |
| 71 | // schema for input fields |
nothing calls this directly
no test coverage detected