diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-07-04 16:32:14 +0200 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-07-04 16:32:14 +0200 |
commit | 40369c781e43282992e720efaaa99fa5e60c0d20 (patch) | |
tree | 3a862e006b000adf3aec77334a62eef8eb6215f4 /modules/codec/tests | |
parent | 596964ba245e17444baa196c16b4531c03f7a4b2 (diff) |
Preparation work for loopback
Diffstat (limited to 'modules/codec/tests')
-rw-r--r-- | modules/codec/tests/forst.cpp | 4 | ||||
-rw-r--r-- | modules/codec/tests/remote_loopback.cpp | 30 |
2 files changed, 34 insertions, 0 deletions
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 @@ -26,6 +26,10 @@ SAW_TEST("Codec Forst Info"){ SAW_EXPECT(depth == 0, "Layer info is wrong"); } { + uint64_t depth = impl::forst_codec_info<schema::String>::layers; + SAW_EXPECT(depth == 1, "Layer info is wrong"); + } + { uint64_t depth = impl::forst_codec_info<TestStruct>::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 <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)); +} +} |