joemarshall commented on code in PR #37821:
URL: https://github.com/apache/arrow/pull/37821#discussion_r1384979751
##########
cpp/src/arrow/util/rle_encoding_test.cc:
##########
@@ -227,10 +234,9 @@ void ValidateRle(const std::vector<int>& values, int
bit_width,
if (expected_len != -1) {
EXPECT_EQ(encoded_len, expected_len);
}
- if (expected_encoding != NULL) {
+ if (expected_encoding != NULL && encoded_len == expected_len) {
Review Comment:
that's a bug in the test which I came across - because it uses `EXPECT_EQ`
as opposed to `ASSERT_EQ` above when checking the two lengths are the same ,
then whilst the test fails, the function continues to run - so in the case an
incorrect length is returned, `memcmp` still runs and is comparing beyond the
length of one of the buffers, and causing the whole test process to crash.
--
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]