From e4e49a117702945066e3e279fa0f005200400cb7 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Wed, 12 Jun 2024 15:04:42 +0200 Subject: Separated Encoding and Storage approaches --- modules/codec/tests/codec.cpp | 58 +++++++++++++++++++++---------------------- modules/codec/tests/csv.cpp | 2 +- 2 files changed, 30 insertions(+), 30 deletions(-) (limited to 'modules/codec/tests') diff --git a/modules/codec/tests/codec.cpp b/modules/codec/tests/codec.cpp index e8a2fb3..10d9d0c 100644 --- a/modules/codec/tests/codec.cpp +++ b/modules/codec/tests/codec.cpp @@ -51,7 +51,7 @@ using TestInterface = Interface< SAW_TEST("One Dimensional Array") { using namespace saw; - data> arr{500u}; + data arr{500u}; int bar = 0; @@ -70,7 +70,7 @@ SAW_TEST("One Dimensional Array") { SAW_TEST("One dim Array Default init"){ using namespace saw; - data> arr; + data 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"); @@ -79,7 +79,7 @@ SAW_TEST("One dim Array Default init"){ SAW_TEST("One dimensional Array Add"){ using namespace saw; - data> arr{5u}; + data arr{5u}; int bar = 0; @@ -96,7 +96,7 @@ SAW_TEST("One dimensional Array Add"){ SAW_TEST("Two Dimensional Array") { using namespace saw; - data> arr{10,30u}; + data arr{10,30u}; int expected_sum = (300 * 301) / 2; @@ -120,7 +120,7 @@ SAW_TEST("Two Dimensional Array") { SAW_TEST("Three Dimensional Array") { using namespace saw; - data> arr{10,10u,3}; + data arr{10,10u,3}; int expected_sum = (300 * 301) / 2; int bar = 0; @@ -146,7 +146,7 @@ SAW_TEST("Three Dimensional Array") { SAW_TEST("KelSimple UInt16 write"){ using namespace saw; - data> native; + data native; data simple; codec codec; @@ -169,7 +169,7 @@ SAW_TEST("KelSimple UInt16 write"){ SAW_TEST("KelSimple UInt32 write"){ using namespace saw; - data> native; + data native; data simple; codec codec; @@ -192,7 +192,7 @@ SAW_TEST("KelSimple UInt32 write"){ SAW_TEST("KelSimple Array write and read back"){ using namespace saw; - data> native{2,3}; + data native{2,3}; data simple; codec codec; @@ -225,7 +225,7 @@ SAW_TEST("KelSimple Array write and read back"){ SAW_TEST("KelSimple Struct write and read back"){ using namespace saw; - data> native; + data native; data simple; auto& tda = native.template get<"two_dim_array">(); @@ -256,7 +256,7 @@ SAW_TEST("KelSimple Struct write and read back"){ SAW_TEST("Native Union same type compilation"){ using namespace saw; - data> native; + data native; native.template init<"two">().set(50u); @@ -269,10 +269,10 @@ SAW_TEST("Native Union same type compilation"){ SAW_TEST("KelSimple Union write and read back"){ using namespace saw; - data> native; + data native; data simple; - native.template set<"number">(data>{}); + native.template set<"number">(data{}); native.template get<"number">().set(410); codec codec; @@ -293,7 +293,7 @@ SAW_TEST("KelSimple Union write and read back"){ SAW_TEST("KelSimple Tuple write and read back"){ using namespace saw; - data> native; + data native; data simple; auto& tda = native.template get<0>(); @@ -324,7 +324,7 @@ SAW_TEST("KelSimple Tuple write and read back"){ SAW_TEST("KelSimple String write and read back"){ using namespace saw; - data> native; + data native; data simple; std::string str = "FooBananaJoe"; @@ -349,14 +349,14 @@ SAW_TEST("Function basics"){ using namespace saw; { - data> native; + data native; native.get<0>().set(5); native.get<1>().set(40); - auto func_add = function_factory>::create( - [](data> req){ - data> resp; + auto func_add = function_factory::create( + [](data req){ + data resp; resp.set(req.get<0>().get() + req.get<1>().get()); @@ -375,36 +375,36 @@ SAW_TEST("Function basics"){ SAW_TEST("Interface basics"){ using namespace saw; - data> native; + data native; auto func_add = - [](data> req){ - data> resp; + [](data req){ + data resp; resp.set(req.get<0>().get() + req.get<1>().get()); return resp; }; auto func_sub = - [](data> req){ - data> resp; + [](data req){ + data resp; resp.set(req.get<0>().get() - req.get<1>().get()); return resp; }; - auto func_multiply = [](data> req){ - data> resp; + auto func_multiply = [](data req){ + data resp; resp.set(req.get<0>().get() * req.get<1>().get()); return resp; }; - auto iface = interface_factory>::create(std::move(func_add), std::move(func_sub), std::move(func_multiply)); + auto iface = interface_factory::create(std::move(func_add), std::move(func_sub), std::move(func_multiply)); { - data> native; + data native; native.get<0>().set(5); native.get<1>().set(40); @@ -415,7 +415,7 @@ SAW_TEST("Interface basics"){ SAW_EXPECT(val.get() == 45, "Sum is incorrect"); } { - data> native; + data native; native.get<0>().set(5); native.get<1>().set(40); @@ -426,7 +426,7 @@ SAW_TEST("Interface basics"){ SAW_EXPECT(val.get() == -35, "Sum is incorrect"); } { - data> native; + data 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 04813c5..638b864 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 > native_data{n_size}; + data native_data{n_size}; { auto& row = native_data.at(0); row.template get<"string">().set("foo"); -- cgit v1.2.3