summaryrefslogtreecommitdiff
path: root/modules/codec/tests
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2024-04-17 15:03:09 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2024-04-17 15:03:09 +0200
commitc1572ff1c275145208333e3e69c29c569689e51b (patch)
tree8c063016008ceac98a926bda5487794f710e3eeb /modules/codec/tests
parent1a2299a70280867b93fde4050833d4bd2b419884 (diff)
Moved to platform description in structs
Diffstat (limited to 'modules/codec/tests')
-rw-r--r--modules/codec/tests/codec.cpp58
-rw-r--r--modules/codec/tests/csv.cpp2
2 files changed, 30 insertions, 30 deletions
diff --git a/modules/codec/tests/codec.cpp b/modules/codec/tests/codec.cpp
index 7113d45..8ffe9f0 100644
--- a/modules/codec/tests/codec.cpp
+++ b/modules/codec/tests/codec.cpp
@@ -50,7 +50,7 @@ using TestInterface = Interface<
SAW_TEST("One Dimensional Array") {
using namespace saw;
- data<schema::OneDimArray, encode::Native> arr{500u};
+ data<schema::OneDimArray, encode::Native<rmt::Host>> arr{500u};
int bar = 0;
@@ -69,7 +69,7 @@ SAW_TEST("One Dimensional Array") {
SAW_TEST("One dim Array Default init"){
using namespace saw;
- data<schema::OneDimArray, encode::Native> arr;
+ data<schema::OneDimArray, encode::Native<rmt::Host>> arr;
SAW_EXPECT(arr.get_dim_size(0) == 0, "Dim should be size 0");
SAW_EXPECT(arr.size() == 0, "Total size should also be zero");
@@ -78,7 +78,7 @@ SAW_TEST("One dim Array Default init"){
SAW_TEST("One dimensional Array Add"){
using namespace saw;
- data<schema::OneDimArray, encode::Native> arr{5u};
+ data<schema::OneDimArray, encode::Native<rmt::Host>> arr{5u};
int bar = 0;
@@ -95,7 +95,7 @@ SAW_TEST("One dimensional Array Add"){
SAW_TEST("Two Dimensional Array") {
using namespace saw;
- data<schema::TwoDimArray, encode::Native> arr{10,30u};
+ data<schema::TwoDimArray, encode::Native<rmt::Host>> arr{10,30u};
int expected_sum = (300 * 301) / 2;
@@ -119,7 +119,7 @@ SAW_TEST("Two Dimensional Array") {
SAW_TEST("Three Dimensional Array") {
using namespace saw;
- data<schema::ThreeDimArray, encode::Native> arr{10,10u,3};
+ data<schema::ThreeDimArray, encode::Native<rmt::Host>> arr{10,10u,3};
int expected_sum = (300 * 301) / 2;
int bar = 0;
@@ -145,7 +145,7 @@ SAW_TEST("Three Dimensional Array") {
SAW_TEST("KelSimple UInt16 write"){
using namespace saw;
- data<schema::UInt16, encode::Native> native;
+ data<schema::UInt16, encode::Native<rmt::Host>> native;
data<schema::UInt16, encode::KelSimple> simple;
codec<schema::UInt16, encode::KelSimple> codec;
@@ -168,7 +168,7 @@ SAW_TEST("KelSimple UInt16 write"){
SAW_TEST("KelSimple UInt32 write"){
using namespace saw;
- data<schema::UInt32, encode::Native> native;
+ data<schema::UInt32, encode::Native<rmt::Host>> native;
data<schema::UInt32, encode::KelSimple> simple;
codec<schema::UInt32, encode::KelSimple> codec;
@@ -191,7 +191,7 @@ SAW_TEST("KelSimple UInt32 write"){
SAW_TEST("KelSimple Array write and read back"){
using namespace saw;
- data<schema::TwoDimArray, encode::Native> native{2,3};
+ data<schema::TwoDimArray, encode::Native<rmt::Host>> native{2,3};
data<schema::TwoDimArray, encode::KelSimple> simple;
codec<schema::TwoDimArray, encode::KelSimple> codec;
@@ -224,7 +224,7 @@ SAW_TEST("KelSimple Array write and read back"){
SAW_TEST("KelSimple Struct write and read back"){
using namespace saw;
- data<schema::TestStruct,encode::Native> native;
+ data<schema::TestStruct,encode::Native<rmt::Host>> native;
data<schema::TestStruct,encode::KelSimple> simple;
auto& tda = native.template get<"two_dim_array">();
@@ -255,7 +255,7 @@ SAW_TEST("KelSimple Struct write and read back"){
SAW_TEST("Native Union same type compilation"){
using namespace saw;
- data<schema::TestSameTypeUnion, encode::Native> native;
+ data<schema::TestSameTypeUnion, encode::Native<rmt::Host>> native;
native.template init<"two">().set(50u);
@@ -268,10 +268,10 @@ SAW_TEST("Native Union same type compilation"){
SAW_TEST("KelSimple Union write and read back"){
using namespace saw;
- data<schema::TestUnion,encode::Native> native;
+ data<schema::TestUnion,encode::Native<rmt::Host>> native;
data<schema::TestUnion,encode::KelSimple> simple;
- native.template set<"number">(data<schema::UInt64, encode::Native>{});
+ native.template set<"number">(data<schema::UInt64, encode::Native<rmt::Host>>{});
native.template get<"number">().set(410);
codec<schema::TestUnion, encode::KelSimple> codec;
@@ -292,7 +292,7 @@ SAW_TEST("KelSimple Union write and read back"){
SAW_TEST("KelSimple Tuple write and read back"){
using namespace saw;
- data<schema::TestTuple,encode::Native> native;
+ data<schema::TestTuple,encode::Native<rmt::Host>> native;
data<schema::TestTuple,encode::KelSimple> simple;
auto& tda = native.template get<0>();
@@ -323,7 +323,7 @@ SAW_TEST("KelSimple Tuple write and read back"){
SAW_TEST("KelSimple String write and read back"){
using namespace saw;
- data<schema::String,encode::Native> native;
+ data<schema::String,encode::Native<rmt::Host>> native;
data<schema::String,encode::KelSimple> simple;
std::string str = "FooBananaJoe";
@@ -348,14 +348,14 @@ SAW_TEST("Function basics"){
using namespace saw;
{
- data<schema::TestInt32Pair, encode::Native> native;
+ data<schema::TestInt32Pair, encode::Native<rmt::Host>> native;
native.get<0>().set(5);
native.get<1>().set(40);
- auto func_add = function_factory<schema::TestCalcFunction, encode::Native>::create(
- [](data<schema::TestInt32Pair, encode::Native> req){
- data<schema::Int32, encode::Native> resp;
+ auto func_add = function_factory<schema::TestCalcFunction, encode::Native<rmt::Host>>::create(
+ [](data<schema::TestInt32Pair, encode::Native<rmt::Host>> req){
+ data<schema::Int32, encode::Native<rmt::Host>> resp;
resp.set(req.get<0>().get() + req.get<1>().get());
@@ -374,36 +374,36 @@ SAW_TEST("Function basics"){
SAW_TEST("Interface basics"){
using namespace saw;
- data<schema::TestInt32Pair, encode::Native> native;
+ data<schema::TestInt32Pair, encode::Native<rmt::Host>> native;
auto func_add =
- [](data<schema::TestInt32Pair, encode::Native> req){
- data<schema::Int32, encode::Native> resp;
+ [](data<schema::TestInt32Pair, encode::Native<rmt::Host>> req){
+ data<schema::Int32, encode::Native<rmt::Host>> resp;
resp.set(req.get<0>().get() + req.get<1>().get());
return resp;
};
auto func_sub =
- [](data<schema::TestInt32Pair, encode::Native> req){
- data<schema::Int32, encode::Native> resp;
+ [](data<schema::TestInt32Pair, encode::Native<rmt::Host>> req){
+ data<schema::Int32, encode::Native<rmt::Host>> resp;
resp.set(req.get<0>().get() - req.get<1>().get());
return resp;
};
- auto func_multiply = [](data<schema::TestInt32Pair, encode::Native> req){
- data<schema::Int32, encode::Native> resp;
+ auto func_multiply = [](data<schema::TestInt32Pair, encode::Native<rmt::Host>> req){
+ data<schema::Int32, encode::Native<rmt::Host>> resp;
resp.set(req.get<0>().get() * req.get<1>().get());
return resp;
};
- auto iface = interface_factory<schema::TestInterface, encode::Native>::create(std::move(func_add), std::move(func_sub), std::move(func_multiply));
+ auto iface = interface_factory<schema::TestInterface, encode::Native<rmt::Host>>::create(std::move(func_add), std::move(func_sub), std::move(func_multiply));
{
- data<schema::TestInt32Pair, encode::Native> native;
+ data<schema::TestInt32Pair, encode::Native<rmt::Host>> native;
native.get<0>().set(5);
native.get<1>().set(40);
@@ -414,7 +414,7 @@ SAW_TEST("Interface basics"){
SAW_EXPECT(val.get() == 45, "Sum is incorrect");
}
{
- data<schema::TestInt32Pair, encode::Native> native;
+ data<schema::TestInt32Pair, encode::Native<rmt::Host>> native;
native.get<0>().set(5);
native.get<1>().set(40);
@@ -425,7 +425,7 @@ SAW_TEST("Interface basics"){
SAW_EXPECT(val.get() == -35, "Sum is incorrect");
}
{
- data<schema::TestInt32Pair, encode::Native> native;
+ data<schema::TestInt32Pair, encode::Native<rmt::Host>> native;
native.get<0>().set(5);
native.get<1>().set(40);
diff --git a/modules/codec/tests/csv.cpp b/modules/codec/tests/csv.cpp
index ac394ce..6e9b124 100644
--- a/modules/codec/tests/csv.cpp
+++ b/modules/codec/tests/csv.cpp
@@ -22,7 +22,7 @@ SAW_TEST("Codec Csv Encode Basic"){
using namespace saw;
size_t n_size = 3;
- data <TestArray, encode::Native> native_data{n_size};
+ data <TestArray, encode::Native<rmt::Host>> native_data{n_size};
{
auto& row = native_data.at(0);
row.template get<"string">().set("foo");