Reranko05 commented on code in PR #50234:
URL: https://github.com/apache/arrow/pull/50234#discussion_r3456326456


##########
ruby/red-arrow/test/test-memory-view.rb:
##########
@@ -29,6 +29,48 @@ def little_endian?
     [1].pack("s") == [1].pack("s<")
   end
 
+  def rb_memory_view_functions
+    libruby = Fiddle.dlopen(nil)
+
+    [
+      Fiddle::Function.new(
+        libruby["rb_memory_view_get"],
+        [
+          Fiddle::TYPE_UINTPTR_T,
+          Fiddle::TYPE_VOIDP,
+          Fiddle::TYPE_INT,
+        ],
+        Fiddle::TYPE_INT
+      ),
+      Fiddle::Function.new(
+        libruby["rb_memory_view_release"],
+        [
+          Fiddle::TYPE_VOIDP,
+        ],
+        Fiddle::TYPE_INT
+      ),
+    ]
+  end
+
+  def assert_memory_view_release(target)
+    rb_memory_view_get, rb_memory_view_release = rb_memory_view_functions
+
+    # Fill the buffer with non-zero garbage to mimic an
+    # uninitialized rb_memory_view_t.
+    view = Fiddle::Pointer.malloc(256)

Review Comment:
   moved the regression tests into a `sub_test_case` as you suggested.



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