Skip to content

Commit

Permalink
Fix the incorrect size calculation logic of FileSink.
Browse files Browse the repository at this point in the history
  • Loading branch information
wypb committed Apr 11, 2024
1 parent 5863b08 commit a18128e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions velox/dwio/common/tests/MemorySinkTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,13 @@ TEST_F(MemorySinkTest, create) {
std::string chars("abcdefghijklmnopqrst");
std::vector<DataBuffer<char>> buffers;

// Add 'abcdefghij' to first buffer
buffers.emplace_back(*pool_);
for (auto i = 0; i < 10; ++i) {
buffers.back().append(chars[i]);
}
buffers.back().append(0, chars.data(), 10);

// Add 'klmnopqrst' to second buffer
buffers.emplace_back(*pool_);
for (auto i = 10; i < chars.length(); ++i) {
buffers.back().append(chars[i]);
}
buffers.back().append(0, chars.data() + 10, 10);

ASSERT_EQ(buffers.size(), 2);

Expand Down

0 comments on commit a18128e

Please sign in to comment.