This is an automated email from the ASF dual-hosted git repository.

apitrou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new cee3fc6  ARROW-5362: [C++] Fix compression test memory usage
cee3fc6 is described below

commit cee3fc62a7bb9f53322507917994937ae0dbff39
Author: Micah Kornfield <[email protected]>
AuthorDate: Tue May 21 12:23:53 2019 +0200

    ARROW-5362: [C++] Fix compression test memory usage
    
    Author: Micah Kornfield <[email protected]>
    
    Closes #4335 from emkornfield/fix_compression_tests and squashes the 
following commits:
    
    86ddd9963 <Micah Kornfield> revert cmopressed size
    e37f8ad55 <Micah Kornfield> Change back to using resize
    9b51c5809 <Micah Kornfield> ARROW-5362: Fix compression test memory usage
---
 cpp/src/arrow/util/compression-test.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/cpp/src/arrow/util/compression-test.cc 
b/cpp/src/arrow/util/compression-test.cc
index bc8cf45..795e0cc 100644
--- a/cpp/src/arrow/util/compression-test.cc
+++ b/cpp/src/arrow/util/compression-test.cc
@@ -86,10 +86,16 @@ void CheckCodecRoundtrip(Compression::type ctype, const 
std::vector<uint8_t>& da
   ASSERT_EQ(data.size(), actual_decompressed_size);
 
   // compress with c2
+  ASSERT_EQ(max_compressed_len,
+            static_cast<int>(c2->MaxCompressedLen(data.size(), data.data())));
+  // Resize to prevent ASAN from detecting container overflow.
+  compressed.resize(max_compressed_len);
+
   int64_t actual_size2;
   ASSERT_OK(c2->Compress(data.size(), data.data(), max_compressed_len, 
compressed.data(),
                          &actual_size2));
   ASSERT_EQ(actual_size2, actual_size);
+  compressed.resize(actual_size2);
 
   // decompress with c1
   ASSERT_OK(c1->Decompress(compressed.size(), compressed.data(), 
decompressed.size(),

Reply via email to