| 1675 | class TestUnaryArithmeticDecimal : public TestArithmeticDecimal {}; |
| 1676 | |
| 1677 | TEST_F(TestUnaryArithmeticDecimal, AbsoluteValue) { |
| 1678 | auto max128 = Decimal128::GetMaxValue(38); |
| 1679 | auto max256 = Decimal256::GetMaxValue(76); |
| 1680 | for (const auto& func : {"abs", "abs_checked"}) { |
| 1681 | for (const auto& ty : PositiveScaleTypes()) { |
| 1682 | CheckScalar(func, {ArrayFromJSON(ty, R"([])")}, ArrayFromJSON(ty, R"([])")); |
| 1683 | CheckScalar(func, {ArrayFromJSON(ty, R"(["1.00", "-42.15", null])")}, |
| 1684 | ArrayFromJSON(ty, R"(["1.00", "42.15", null])")); |
| 1685 | } |
| 1686 | CheckScalar( |
| 1687 | func, |
| 1688 | ScalarVector{std::make_shared<Decimal128Scalar>(-max128, decimal128(38, 0))}, |
| 1689 | std::make_shared<Decimal128Scalar>(max128, decimal128(38, 0))); |
| 1690 | CheckScalar( |
| 1691 | func, |
| 1692 | ScalarVector{std::make_shared<Decimal256Scalar>(-max256, decimal256(76, 0))}, |
| 1693 | std::make_shared<Decimal256Scalar>(max256, decimal256(76, 0))); |
| 1694 | for (const auto& ty : NegativeScaleTypes()) { |
| 1695 | CheckScalar(func, {ArrayFromJSON(ty, R"([])")}, ArrayFromJSON(ty, R"([])")); |
| 1696 | CheckScalar(func, {DecimalArrayFromJSON(ty, R"(["12E2", "-42E2", null])")}, |
| 1697 | DecimalArrayFromJSON(ty, R"(["12E2", "42E2", null])")); |
| 1698 | } |
| 1699 | } |
| 1700 | } |
| 1701 | |
| 1702 | TYPED_TEST(TestUnaryArithmeticUnsigned, Exp) { |
| 1703 | auto exp = [](const Datum& arg, ArithmeticOptions, ExecContext* ctx) { |
nothing calls this directly
no test coverage detected