Reranko05 commented on code in PR #50545:
URL: https://github.com/apache/arrow/pull/50545#discussion_r3645746895
##########
cpp/src/gandiva/precompiled/extended_math_ops_test.cc:
##########
@@ -203,6 +203,11 @@ TEST(TestExtendedMathOps, TestRound) {
EXPECT_EQ(round_int64_int32(-23453462343, -4), -23453460000);
EXPECT_EQ(round_int64_int32(-23453462343, -5), -23453500000);
EXPECT_EQ(round_int64_int32(345353425343, -12), 0);
+
+ // The most negative precision must be rejected by the range check rather
than
+ // negated into an out-of-range table index.
+ EXPECT_EQ(round_int32_int32(1234, std::numeric_limits<int32_t>::min()), 0);
+ EXPECT_EQ(round_int64_int32(345353425343,
std::numeric_limits<int32_t>::min()), 0);
Review Comment:
Would it make sense to also add tests for the `-9`/`-10` boundary (and
`-18`/`-19` for the int64 overload)? They could help catch any future
off-by-one regressions around the new range check.
--
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]