summaryrefslogtreecommitdiff
path: root/modules/codec/tests/forst.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/codec/tests/forst.cpp')
-rw-r--r--modules/codec/tests/forst.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/modules/codec/tests/forst.cpp b/modules/codec/tests/forst.cpp
new file mode 100644
index 0000000..cb0442d
--- /dev/null
+++ b/modules/codec/tests/forst.cpp
@@ -0,0 +1,29 @@
+#include <forstio/test/suite.hpp>
+#include "../c++/data.hpp"
+#include "../c++/forst.hpp"
+
+#include <iostream>
+
+namespace {
+namespace schema {
+using namespace saw::schema;
+
+using TestStruct = Struct<
+ Member<String, "string">,
+ Member<UInt64, "number">,
+ Member<Int8, "signed">
+>;
+
+using TestArray = Array<
+ TestStruct
+>;
+
+SAW_TEST("Codec Forst Info"){
+ using namespace saw;
+
+ SAW_EXPECT(impl::forst_codec_info<schema::UInt64>::layers == 0, "Layer info is wrong");
+ SAW_EXPECT(impl::forst_codec_info<TestStruct>::layers == 1, "Layer info is wrong");
+ SAW_EXPECT(impl::forst_codec_info<TestArray>::layers == 2, "Layer info is wrong");
+}
+}
+}