summaryrefslogtreecommitdiff
path: root/modules/remote/tests/remote_loopback.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/remote/tests/remote_loopback.cpp')
-rw-r--r--modules/remote/tests/remote_loopback.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/modules/remote/tests/remote_loopback.cpp b/modules/remote/tests/remote_loopback.cpp
index 0450c21..d6f1e73 100644
--- a/modules/remote/tests/remote_loopback.cpp
+++ b/modules/remote/tests/remote_loopback.cpp
@@ -28,16 +28,22 @@ SAW_TEST("Remote Loopback RPC"){
SAW_EXPECT(eo_u32_srv.is_value(), std::string{"Couldn't listen: "} + std::string{eo_u32_srv.get_error().get_category()});
auto& u32_srv = eo_u32_srv.get_value();
- auto eo_u64_srv = rmt.template data_listen<sch::UInt64, encode::Native>(*addr);
- SAW_EXPECT(eo_u64_srv.is_value(), std::string{"Couldn't listen: "} + std::string{eo_u64_srv.get_error().get_category()});
- auto& u64_srv = eo_u64_srv.get_value();
+ auto eo_i64_srv = rmt.template data_listen<sch::Int64, encode::Native>(*addr);
+ SAW_EXPECT(eo_i64_srv.is_value(), std::string{"Couldn't listen: "} + std::string{eo_i64_srv.get_error().get_category()});
+ auto& i64_srv = eo_i64_srv.get_value();
- auto eo_rpc_srv = rmt.template listen<sch::TestInterface>(*addr);
+ auto eo_rpc_srv = rmt.template rpc_listen<sch::TestInterface, encode::Native>(*addr, {
+ [](data<sch::UInt32, encode::Native> input) -> error_or<data<sch::Int64, encode::Native>> {
+ data<sch::Int64, encode::Native> rv;
+ rv.set(input.get() * 2);
+ return rv;
+ }
+ });
SAW_EXPECT(eo_rpc_srv.is_value(), std::string{"Couldn't listen: "} + std::string{eo_rpc_srv.get_error().get_category()});
auto& rpc_srv = eo_rpc_srv.get_value();
id<sch::UInt32> id32{0u};
- id<sch::UInt64> id64{0u};
+ id<sch::Int64> id64{0u};
}