summaryrefslogtreecommitdiff
path: root/modules/codec/tests
diff options
context:
space:
mode:
authorClaudius 'keldu' Holeksa <mail@keldu.de>2024-07-25 14:56:53 +0200
committerClaudius 'keldu' Holeksa <mail@keldu.de>2024-07-25 14:56:53 +0200
commit3ad1f9e4147cf64627793d4003b50039d86ce995 (patch)
tree46453536ac659cf11c9eb9c423b1c397e0d1e817 /modules/codec/tests
parent19590864723d5a423b75b4f06ad7005a0a93f475 (diff)
wip
Diffstat (limited to 'modules/codec/tests')
-rw-r--r--modules/codec/tests/forst.cpp33
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));
+ }
+}
}
}