diff options
Diffstat (limited to 'modules/codec/tests/remote_loopback.cpp')
-rw-r--r-- | modules/codec/tests/remote_loopback.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/modules/codec/tests/remote_loopback.cpp b/modules/codec/tests/remote_loopback.cpp new file mode 100644 index 0000000..2f6c06c --- /dev/null +++ b/modules/codec/tests/remote_loopback.cpp @@ -0,0 +1,30 @@ +#include <forstio/test/suite.hpp> + +#include "remote_loopback.hpp" + +namespace { +namespace sch { +using namespace saw::schema; + +using TestInterface = Interface< + Member<Function<UInt32, Int64>, "foo"> +>; +} + +SAW_TEST("Remote Loopback"){ + using namespace saw; + + remote<rmt::Loopback> rmt; + + auto eov = rmt.parse_address(); + SAW_EXPECT(eov.is_value(), "Didn't parse correctly"); + auto& val = eov.get_value(); + + interface<sch::TestInterface, encode::Native, storage::Default> iface{ + [](data<sch::UInt32>& foo){ + return foo.template cast<sch::Int64>(); + } + }; + auto rpc_srv = rmt.listen(*val, std::move(iface)); +} +} |