#include #include "../c++/data.hpp" #include "../c++/forst.hpp" #include "../c++/schema_meta.hpp" #include namespace { namespace sch { using namespace saw::schema; using TestStruct = Struct< Member, Member, Member >; using TestArray = Array< TestStruct >; SAW_TEST("Codec Forst Layer Info"){ using namespace saw; { uint64_t depth = impl::forst_codec_info::layers; SAW_EXPECT(depth == 0, "Layer info is wrong"); } { uint64_t depth = impl::forst_codec_info::layers; SAW_EXPECT(depth == 1, "Layer info is wrong"); } { uint64_t depth = impl::forst_codec_info::layers; SAW_EXPECT(depth == 1, "Layer info is wrong"); } { uint64_t depth = impl::forst_codec_info::layers; SAW_EXPECT(depth == 2, "Layer info is wrong"); } } SAW_TEST("Codec Forst Static Size Info"){ using namespace saw; { uint64_t depth = impl::forst_codec_info::static_size; SAW_EXPECT(depth == 8u, "Static size is wrong"); } { uint64_t size = impl::forst_codec_info::static_size; SAW_EXPECT(size == 1u, "Static size is wrong"); } { uint64_t size = impl::forst_codec_info::static_size; SAW_EXPECT(size == 2u, "Static size is wrong"); } { uint64_t size = impl::forst_codec_info::static_size; SAW_EXPECT(size == 4u, "Static size is wrong"); } { uint64_t size = impl::forst_codec_info::static_size; SAW_EXPECT(size == 8u, "Static size is wrong"); } { uint64_t size = impl::forst_codec_info::static_size; SAW_EXPECT(size == 17u, std::string{"Static size is wrong: "} + std::to_string(size)); } } SAW_TEST("Codec Forst Primitive"){ using namespace saw; data forst_dat; uint64_t foo = 4213u; forst_dat.set(foo); uint64_t val = forst_dat.get(); SAW_EXPECT(val == foo, "Unexpected value"); } } }