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 10, 2024
1 parent 78893a0 commit eccc6a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions velox/dwio/common/tests/MemorySinkTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ TEST_F(MemorySinkTest, create) {
for (auto i = 10; i < chars.length(); ++i) {
buffers.back().append(chars[i]);
}

EXPECT_EQ(buffers.size(), 2);

auto memorySink = std::make_unique<MemorySink>(
1024, dwio::common::FileSink::Options{.pool = pool_.get()});

ASSERT_TRUE(memorySink->isBuffered());
EXPECT_EQ(buffers.size(), 2);

// Write data to MemorySink.
memorySink->write(buffers);
EXPECT_EQ(memorySink->size(), chars.length());
EXPECT_EQ(memorySink->data(), chars);
Expand Down

0 comments on commit eccc6a1

Please sign in to comment.