summaryrefslogtreecommitdiff
path: root/modules/codec/tests
diff options
context:
space:
mode:
authorClaudius 'keldu' Holeksa <mail@keldu.de>2024-07-15 16:38:25 +0200
committerClaudius 'keldu' Holeksa <mail@keldu.de>2024-07-15 16:38:25 +0200
commit6b68a4f7ddac183f460b668bee7a385daada0ce5 (patch)
tree61e960a96fc35e040f3e7c4f7e649344e30846bc /modules/codec/tests
parent816760c8480e8e76c7f4021a845161eb697e215c (diff)
Move files and ammend remote-sycl
Diffstat (limited to 'modules/codec/tests')
-rw-r--r--modules/codec/tests/remote_loopback.cpp73
1 files changed, 0 insertions, 73 deletions
diff --git a/modules/codec/tests/remote_loopback.cpp b/modules/codec/tests/remote_loopback.cpp
deleted file mode 100644
index 2895ee7..0000000
--- a/modules/codec/tests/remote_loopback.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-#include <forstio/test/suite.hpp>
-
-#include "../c++/remote_loopback.hpp"
-
-namespace {
-namespace sch {
-using namespace saw::schema;
-
-using TestInterface = Interface<
- Member<Function<UInt32, Int64>, "foo">
->;
-
-using GroupedSchemas = saw::tmpl_group<
- UInt64,
- String,
- Array<Int32>,
- Float64
->;
-}
-
-SAW_TEST("Remote Loopback Data"){
- 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_to<sch::Int64>();
- }
- };
-
- auto srv = data_server<sch::GroupedSchemas, encode::Native, rmt::Loopback>{};
- auto client = data_client<sch::GroupedSchemas, encode::Native, rmt::Loopback>{srv};
-
- data<sch::UInt64> foo{421};
- id<sch::UInt64> sent_id = [&](){
- auto eov = client.send(foo);
- SAW_EXPECT(eov.is_value(), "Failed send.");
- return eov.get_value();
- }();
-
- event_loop loop;
- wait_scope wait{loop};
-
- {
- auto conv = client.receive(sent_id);
- auto eov = conv.take();
-
- SAW_EXPECT(eov.is_value(), "Failed receive.");
- SAW_EXPECT(eov.get_value() == foo, "Wrong received value.");
- }
- {
- auto eov = client.find(sent_id);
- SAW_EXPECT(eov.is_value(), "Failed find.");
- auto& f_val = eov.get_value();
- SAW_EXPECT(f_val, "Nullptr in find.");
- SAW_EXPECT(*f_val == foo, "Wrong received value.");
- }
- {
- auto eov = client.erase(sent_id);
- SAW_EXPECT(eov.is_value(), "Failed erase.");
- }
- {
- auto conv = client.receive(sent_id);
- auto eov = conv.take();
- SAW_EXPECT(!eov.is_value(), "Failed receive. Value should already be erased.");
- }
-}
-}