summaryrefslogtreecommitdiff
path: root/modules/codec/tests
diff options
context:
space:
mode:
Diffstat (limited to 'modules/codec/tests')
-rw-r--r--modules/codec/tests/forst.cpp4
-rw-r--r--modules/codec/tests/remote_loopback.cpp30
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));
+}
+}