pitrou commented on code in PR #37360:
URL: https://github.com/apache/arrow/pull/37360#discussion_r1309881588
##########
cpp/src/arrow/io/memory_test.cc:
##########
@@ -283,12 +283,42 @@ TEST(TestBufferReader, WillNeed) {
}
{
std::string data = "data123456";
- BufferReader reader(reinterpret_cast<const uint8_t*>(data.data()),
- static_cast<int64_t>(data.size()));
+ auto reader = BufferReader::FromString(data);
- ASSERT_OK(reader.WillNeed({{0, 4}, {4, 6}}));
- ASSERT_RAISES(IOError, reader.WillNeed({{11, 1}})); // Out of bounds
+ ASSERT_OK(reader->WillNeed({{0, 4}, {4, 6}}));
+ ASSERT_RAISES(IOError, reader->WillNeed({{11, 1}})); // Out of bounds
+ }
+}
+
+void TestBufferReaderLifetime(
+ std::function<std::unique_ptr<BufferReader>(std::string&)> fn,
+ bool supports_zero_copy) {
Review Comment:
Why pass `supports_zero_copy` since it's always true?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]