MCPcopy Create free account
hub / github.com/apache/arrow / TEST_F

Function TEST_F

cpp/src/arrow/compute/kernels/scalar_arithmetic_test.cc:1677–1700  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1675class TestUnaryArithmeticDecimal : public TestArithmeticDecimal {};
1676
1677TEST_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
1702TYPED_TEST(TestUnaryArithmeticUnsigned, Exp) {
1703 auto exp = [](const Datum& arg, ArithmeticOptions, ExecContext* ctx) {

Callers

nothing calls this directly

Calls 15

GetMaxValueFunction · 0.85
CheckScalarFunction · 0.85
ArrayFromJSONFunction · 0.85
decimal256Function · 0.85
DecimalArrayFromJSONFunction · 0.85
ScalarFromJSONFunction · 0.85
CallFunctionFunction · 0.85
CheckDispatchExactFunction · 0.85
CheckDispatchExactFailsFunction · 0.85
CheckDispatchBestFunction · 0.85
CheckScalarBinaryFunction · 0.85

Tested by

no test coverage detected