blob: 28501c9afaca3a391d74b84d93ea034d67763c9b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#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;
{
uint64_t depth = impl::forst_codec_info<schema::UInt64>::layers;
SAW_EXPECT(depth == 0, "Layer info is wrong");
}
{
uint64_t depth = impl::forst_codec_info<schema::String>::layers;
SAW_EXPECT(depth == 1, "Layer info is wrong");
}
{
uint64_t depth = impl::forst_codec_info<TestStruct>::layers;
SAW_EXPECT(depth == 1, "Layer info is wrong");
}
{
uint64_t depth = impl::forst_codec_info<TestArray>::layers;
SAW_EXPECT(depth == 2, "Layer info is wrong");
}
}
}
}
|