tree: a144fb276996dfec4d36bfaa390a4d659a9a4e54 [path history] [tgz]
  1. BUILD.gn
  2. coding_tables.test.fidl
  3. coding_tables_tests.cpp
  4. README.md
zircon/system/utest/fidl-coding-tables/README.md

FIDL Coding Tables Tests

The FIDL compiler generates coding tables, which are instructions for the walker/visitor to encode/decode messages. This test suite runs the FIDL compiler at compile time and verifies important properties of the generated coding table at run time. Its purpose is to test the tables generator in fidlc in a flexible manner.

For example, given the following FIDL definition:

library example;
xunion MyMessage {
    int32 a;
    int64 b;
    SomeStruct c;
};

It is expected to generate coding tables along the lines of:

static const ::fidl::FidlXUnionField example_MyMessageFields[] = {
    ::fidl::FidlXUnionField(&fidl::internal::kInt32Table, [... xunion ordinal for a ...]),
    ::fidl::FidlXUnionField(&fidl::internal::kInt64Table, [... xunion ordinal for b ...]),
    ::fidl::FidlXUnionField(&example_SomeStructTable, [... xunion ordinal for c ...])
};
const fidl_type_t example_MyMessageTable =
    fidl_type_t(::fidl::FidlCodedXUnion(3, example_MyMessageFields, "example/MyMessage"));

The test will check that the pointers in the coding tables are as expected.