Skip to content

Commit b3a68e6

Browse files
committed
Fix valgrind error in test fixture
1 parent 1fe7764 commit b3a68e6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cpp/src/arrow/parquet/parquet-io-test.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ class BufferReader : public io::RandomAccessFile {
120120

121121
Status Read(int64_t nbytes, int64_t* bytes_read, uint8_t* buffer) override {
122122
memcpy(buffer, buffer_ + position_, nbytes);
123-
position_ += nbytes;
123+
*bytes_read = std::min(nbytes, buffer_size_ - position_);
124+
position_ += *bytes_read;
124125
return Status::OK();
125126
}
126127

@@ -172,7 +173,7 @@ TEST(TestParquetReadSource, Basics) {
172173

173174
auto expected_buffer = std::make_shared<::parquet::Buffer>(data_buffer + 4, 7);
174175

175-
ASSERT_TRUE(expected_buffer->Equals(*pq_buffer));
176+
ASSERT_TRUE(expected_buffer->Equals(*pq_buffer.get()));
176177
}
177178

178179
} // namespace parquet

0 commit comments

Comments
 (0)