bkietz commented on code in PR #38443:
URL: https://github.com/apache/arrow/pull/38443#discussion_r1409425143


##########
cpp/src/arrow/c/bridge_test.cc:
##########
@@ -887,6 +905,32 @@ TEST_F(TestArrayExport, PrimitiveSliced) {
   TestPrimitive(factory);
 }
 
+constexpr std::string_view binary_view_buffer_content0 = "12345foo bar baz 
quux",
+                           binary_view_buffer_content1 = 
"BinaryViewMultipleBuffers";
+
+static const BinaryViewType::c_type binary_view_buffer1[] = {
+    util::ToBinaryView(binary_view_buffer_content0, 0, 0),
+    util::ToInlineBinaryView("foo"),
+    util::ToBinaryView(binary_view_buffer_content1, 1, 0),
+    util::ToInlineBinaryView("bar"),
+    util::ToBinaryView(binary_view_buffer_content0.substr(5), 0, 5),
+    util::ToInlineBinaryView("baz"),
+    util::ToBinaryView(binary_view_buffer_content1.substr(6, 13), 1, 6),
+    util::ToInlineBinaryView("quux"),
+};
+
+TEST_F(TestArrayExport, BinaryViewMultipleBuffers) {
+  auto length = static_cast<int64_t>(std::size(binary_view_buffer1));
+  auto arr = std::make_shared<BinaryViewArray>(
+      binary_view(), length, Buffer::Wrap(binary_view_buffer1, length),
+      BufferVector{
+          std::make_shared<Buffer>(binary_view_buffer_content0),
+          std::make_shared<Buffer>(binary_view_buffer_content1),
+      });
+  TestNested([&] { return arr; });

Review Comment:
   I'll use TestPrimitive and copy those buffers onto the heap



-- 
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]

Reply via email to