From 40369c781e43282992e720efaaa99fa5e60c0d20 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Thu, 4 Jul 2024 16:32:14 +0200 Subject: Preparation work for loopback --- modules/codec/tests/forst.cpp | 4 ++++ modules/codec/tests/remote_loopback.cpp | 30 ++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 modules/codec/tests/remote_loopback.cpp (limited to 'modules/codec/tests') diff --git a/modules/codec/tests/forst.cpp b/modules/codec/tests/forst.cpp index 96c4dd0..28501c9 100644 --- a/modules/codec/tests/forst.cpp +++ b/modules/codec/tests/forst.cpp @@ -25,6 +25,10 @@ SAW_TEST("Codec Forst Info"){ uint64_t depth = impl::forst_codec_info::layers; SAW_EXPECT(depth == 0, "Layer info is wrong"); } + { + uint64_t depth = impl::forst_codec_info::layers; + SAW_EXPECT(depth == 1, "Layer info is wrong"); + } { uint64_t depth = impl::forst_codec_info::layers; SAW_EXPECT(depth == 1, "Layer info is wrong"); 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 + +#include "remote_loopback.hpp" + +namespace { +namespace sch { +using namespace saw::schema; + +using TestInterface = Interface< + Member, "foo"> +>; +} + +SAW_TEST("Remote Loopback"){ + using namespace saw; + + remote rmt; + + auto eov = rmt.parse_address(); + SAW_EXPECT(eov.is_value(), "Didn't parse correctly"); + auto& val = eov.get_value(); + + interface iface{ + [](data& foo){ + return foo.template cast(); + } + }; + auto rpc_srv = rmt.listen(*val, std::move(iface)); +} +} -- cgit v1.2.3