amassalha commented on code in PR #38272:
URL: https://github.com/apache/arrow/pull/38272#discussion_r1398401008
##########
cpp/src/arrow/util/compression_test.cc:
##########
@@ -368,6 +368,42 @@ TEST_P(CodecTest, CodecRoundtrip) {
}
}
+TEST(CodecTest, CodecRoundtripGzipMembers) {
+ std::unique_ptr<Codec> gzip_codec;
+ ASSERT_OK_AND_ASSIGN(gzip_codec, Codec::Create(Compression::GZIP));
+
+ for (int data_half_size : {0, 10000, 100000}) {
+ int64_t actual_size_p1, actual_size_p2;
+ std::vector<uint8_t> data_half = MakeRandomData(data_half_size);
+ std::vector<uint8_t> data_full(data_half.begin(), data_half.end());
+ data_full.insert(data_full.end(), data_half.begin(), data_half.end());
+
+ int max_compressed_len_half =
+ static_cast<int>(gzip_codec->MaxCompressedLen(data_half.size(),
data_half.data()));
+ std::vector<uint8_t> compressed(max_compressed_len_half * 2);
+
+ // Compress in 2 steps
+ ASSERT_OK_AND_ASSIGN(actual_size_p1,
+ gzip_codec->Compress(data_half.size(),
data_half.data(),
+ max_compressed_len_half,
compressed.data()));
+ ASSERT_OK_AND_ASSIGN(
Review Comment:
hmm why? Im not sure I agree
I think as more the test is simple and precise is better for the test case
and make it more clear...
but anyway if its important for you I will change it to 3 or 4 parts
I though of adding 1 extra test with 3 or 4 parts, but this will be 2 tests
testing same thing (redundant), so I think signel test is better, with 2 part
or with 3 / 4 ...
--
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]