From 87db03e9ffa559eaf5f6b970ad42776f33ae34b2 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Thu, 8 Jan 2026 19:03:09 +0100 Subject: dangling --- modules/codec/tests/args.cpp | 2 +- modules/codec/tests/forst.cpp | 18 +++++++++++++- modules/codec/tests/print.cpp | 57 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 modules/codec/tests/print.cpp (limited to 'modules/codec/tests') diff --git a/modules/codec/tests/args.cpp b/modules/codec/tests/args.cpp index f42056a..2b5b14c 100644 --- a/modules/codec/tests/args.cpp +++ b/modules/codec/tests/args.cpp @@ -40,7 +40,7 @@ SAW_TEST("Codec Args Decode Basic"){ codec, encode::Args> args_codec; auto eov = args_codec.decode(dat_args, dat_nat); - SAW_EOV_EXPECT(eov, "Couldn't decode data. "); + SAW_EXPECT_EOV(eov, "Couldn't decode data"); auto& prog = dat_nat.template get<"program">(); auto& str = dat_nat.template get<"args">(); diff --git a/modules/codec/tests/forst.cpp b/modules/codec/tests/forst.cpp index 1d9c0c3..2bf6442 100644 --- a/modules/codec/tests/forst.cpp +++ b/modules/codec/tests/forst.cpp @@ -18,7 +18,7 @@ using TestStruct = Struct< using TestArray = Array< TestStruct >; - +/* SAW_TEST("Codec Forst Layer Info"){ using namespace saw; @@ -82,5 +82,21 @@ SAW_TEST("Codec Forst Primitive"){ SAW_EXPECT(val == foo, "Unexpected value"); } + +SAW_TEST("Codec Forst Struct of Primitives"){ + using namespace saw; + + data test_dat; + + auto& test_a = test_dat.template get<"string">(); + auto& test_b = test_dat.template get<"number">(); + auto& test_c = test_dat.template get<"signed">(); + + test_b.set(50u); + test_c.set(-23); + test_a.set("cheese"); + +} +*/ } } diff --git a/modules/codec/tests/print.cpp b/modules/codec/tests/print.cpp new file mode 100644 index 0000000..695f7a0 --- /dev/null +++ b/modules/codec/tests/print.cpp @@ -0,0 +1,57 @@ +#include +#include "../c++/data_print.hpp" + +namespace { +namespace sch { +using namespace saw::schema; + +using TestStruct = Struct< + Member, + Member, + Member, + Member +>; +} + +/* +SAW_TEST("Math/Basic"){ + using namespace saw; + + data> a; + data> b; + + auto c = a + b; +} +*/ + +SAW_TEST("Data Print/Primitive Float64"){ + using namespace saw; + + + data a{40.1}; + + std::stringstream oss; + oss< a; + + auto& banana = a.template get<"banana">(); + + banana.set("banned"); + + std::stringstream oss; + oss<