diff options
Diffstat (limited to 'modules/codec/tests/forst.cpp')
-rw-r--r-- | modules/codec/tests/forst.cpp | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/modules/codec/tests/forst.cpp b/modules/codec/tests/forst.cpp index 28501c9..8e9ac49 100644 --- a/modules/codec/tests/forst.cpp +++ b/modules/codec/tests/forst.cpp @@ -5,7 +5,7 @@ #include <iostream> namespace { -namespace schema { +namespace sch { using namespace saw::schema; using TestStruct = Struct< @@ -18,7 +18,7 @@ using TestArray = Array< TestStruct >; -SAW_TEST("Codec Forst Info"){ +SAW_TEST("Codec Forst Layer Info"){ using namespace saw; { @@ -38,5 +38,34 @@ SAW_TEST("Codec Forst Info"){ 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<schema::String>::static_size; + SAW_EXPECT(depth == 8u, "Static size is wrong"); + } + { + uint64_t size = impl::forst_codec_info<schema::UInt8>::static_size; + SAW_EXPECT(size == 1u, "Static size is wrong"); + } + { + uint64_t size = impl::forst_codec_info<schema::UInt16>::static_size; + SAW_EXPECT(size == 2u, "Static size is wrong"); + } + { + uint64_t size = impl::forst_codec_info<schema::UInt32>::static_size; + SAW_EXPECT(size == 4u, "Static size is wrong"); + } + { + uint64_t size = impl::forst_codec_info<schema::UInt64>::static_size; + SAW_EXPECT(size == 8u, "Static size is wrong"); + } + { + uint64_t size = impl::forst_codec_info<TestStruct>::static_size; + SAW_EXPECT(size == 17u, std::string{"Static size is wrong: "} + std::to_string(size)); + } +} } } |