blob: 16c2b8f38b6d06bf0c0f9fda87c709edac69998f [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library test.conformance;
type EmptyTable = table {};
type StructOfEmptyTable = struct {
table EmptyTable;
};
type SimpleTable = table {
1: x int64;
5: y int64;
};
type StructOfSimpleTable = struct {
table SimpleTable;
};
type SimpleResourceTable = resource table {
1: x int64;
5: y int64;
};
type StructOfSimpleResourceTable = resource struct {
table SimpleResourceTable;
};
type SimpleTableThenUint64 = struct {
table SimpleTable;
number uint64;
};
type TableWithStringAndVector = table {
1: foo string;
2: bar int32;
3: baz vector<uint8>;
};
type StructOfTableWithStringAndVector = struct {
table TableWithStringAndVector;
};
type ReverseOrdinalTable = table {
4: x int64;
2: y int64;
1: z int64;
};
type StructOfReverseOrdinalTable = struct {
table ReverseOrdinalTable;
};
type TableWithGaps = table {
2: second int32;
4: fourth int32;
};
type StructOfTableWithGaps = struct {
table TableWithGaps;
};
type TableFieldInlined = table {
1: f int32;
};
type TableFieldInlinedStruct = struct {
t TableFieldInlined;
};
type TableFieldInlinedHandle = resource table {
1: f handle:CHANNEL;
};
type TableFieldInlinedHandleStruct = resource struct {
t TableFieldInlinedHandle;
};
type TableFieldOutOfLine = table {
1: f int64;
};
type TableFieldOutOfLineStruct = struct {
t TableFieldOutOfLine;
};
type TableFieldUnknown = table {};
type TableFieldUnknownStruct = struct {
t TableFieldUnknown;
};
type TableFieldUnknownResource = resource table {};
type TableFieldUnknownResourceStruct = resource struct {
t TableFieldUnknownResource;
};
type TableFieldUnsetFlexibleEnumInlined = table {
1: signed_enum flexible enum : int32 {
DEFAULT = 1;
};
2: unsigned_enum flexible enum : uint16 {
DEFAULT = 1;
};
// This field is necessary to ensure that the `unsigned_enum` field is not truncated out of
// existence when unset.
3: always_set bool;
};
type TableFieldUnsetFlexibleEnumInlinedStruct = struct {
t TableFieldUnsetFlexibleEnumInlined;
};