pitrou commented on a change in pull request #11919:
URL: https://github.com/apache/arrow/pull/11919#discussion_r766019940
##########
File path: r/tests/testthat/test-python.R
##########
@@ -143,3 +143,70 @@ test_that("RecordBatchReader from python", {
expect_r6_class(rt_table, "Table")
expect_identical(as.data.frame(rt_table), example_data)
})
+
+test_that("Pointer wrapper accepts external pointers", {
+ ptr <- allocate_arrow_schema()
+ exportable <- int32()
+ exportable$export_to_c(ptr)
+
+ # make sure exportable is released and deleted
+ expect_equal(DataType$import_from_c(ptr), int32())
+ delete_arrow_schema(ptr)
+})
+
+test_that("Pointer wrapper accepts double-casted pointers", {
+ ptr <- allocate_arrow_schema()
+ exportable <- int32()
+ exportable$export_to_c(external_pointer_addr_double(ptr))
+
+ # make sure exportable is released and deleted
+ expect_equal(DataType$import_from_c(ptr), int32())
Review comment:
Should `import_from_c` also take `external_pointer_addr_double(ptr)`?
(same question below)
--
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]