aboutsummaryrefslogtreecommitdiff
path: root/orc-rt/unittests/SPSWrapperFunctionTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'orc-rt/unittests/SPSWrapperFunctionTest.cpp')
-rw-r--r--orc-rt/unittests/SPSWrapperFunctionTest.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/orc-rt/unittests/SPSWrapperFunctionTest.cpp b/orc-rt/unittests/SPSWrapperFunctionTest.cpp
index d9f34e6..d0f06e8 100644
--- a/orc-rt/unittests/SPSWrapperFunctionTest.cpp
+++ b/orc-rt/unittests/SPSWrapperFunctionTest.cpp
@@ -180,7 +180,7 @@ round_trip_int_pointer_sps_wrapper(orc_rt_SessionRef Session, void *CallCtx,
});
}
-TEST(SPSWrapperFunctionUtilsTest, TransparentSerializationPointers) {
+TEST(SPSWrapperFunctionUtilsTest, TransparentConversionPointers) {
int X = 42;
int *P = nullptr;
SPSWrapperFunction<SPSExecutorAddr(SPSExecutorAddr)>::call(
@@ -190,6 +190,17 @@ TEST(SPSWrapperFunctionUtilsTest, TransparentSerializationPointers) {
EXPECT_EQ(P, &X);
}
+TEST(SPSWrapperFunctionUtilsTest, TransparentConversionReferenceArguments) {
+ int X = 42;
+ int *P = nullptr;
+ SPSWrapperFunction<SPSExecutorAddr(SPSExecutorAddr)>::call(
+ DirectCaller(nullptr, round_trip_int_pointer_sps_wrapper),
+ [&](Expected<int32_t *> R) { P = cantFail(std::move(R)); },
+ static_cast<int *const &>(&X));
+
+ EXPECT_EQ(P, &X);
+}
+
static void
expected_int_pointer_sps_wrapper(orc_rt_SessionRef Session, void *CallCtx,
orc_rt_WrapperFunctionReturn Return,
@@ -201,7 +212,7 @@ expected_int_pointer_sps_wrapper(orc_rt_SessionRef Session, void *CallCtx,
});
}
-TEST(SPSWrapperFunctionUtilsTest, TransparentSerializationExpectedPointers) {
+TEST(SPSWrapperFunctionUtilsTest, TransparentConversionExpectedPointers) {
int X = 42;
int *P = nullptr;
SPSWrapperFunction<SPSExpected<SPSExecutorAddr>(SPSExecutorAddr)>::call(