emkornfield commented on a change in pull request #6985: URL: https://github.com/apache/arrow/pull/6985#discussion_r419855029
########## File path: cpp/src/arrow/util/bit_util_test.cc ########## @@ -315,6 +318,115 @@ TEST(FirstTimeBitmapWriter, NormalOperation) { } } +std::string BitmapToString(const uint8_t* bitmap, int64_t bit_count) { + return arrow::internal::Bitmap(bitmap, /*offset*/ 0, /*length=*/bit_count).ToString(); +} + +std::string BitmapToString(const std::vector<uint8_t>& bitmap, int64_t bit_count) { + return BitmapToString(bitmap.data(), bit_count); +} + +TEST(FirstTimeBitmapWriter, AppendWordOffsetOverwritesCorrectBitsOnExistingByte) { + auto check_append = [](const std::string& expected_bits, int64_t offset) { + std::vector<uint8_t> valid_bits = {0x00}; Review comment: I added variants to this test. Note that I don't think have a bitmap full of 111s iand overwriting trailing ones isn't really expected because any not processed are expected to be zero. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org