blob: 759ae01b8fa2ff915ce5e9c6ab59a9aa1d024481 [file]
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
namespace fuzztest.internal;
enum ByteEnum:byte {
First,
Second,
}
enum ShortEnum:short {
First,
Second,
}
enum IntEnum:int {
First,
Second,
}
enum LongEnum:long {
First,
Second,
}
enum UByteEnum:ubyte {
First,
Second,
}
enum UShortEnum:ushort {
First,
Second,
}
enum UIntEnum:uint {
First,
Second,
}
enum ULongEnum:ulong {
First,
Second,
}
struct BoolStruct {
b:bool;
a_b:[bool:2];
}
struct DefaultStruct {
b:bool;
i8:byte;
i16:short;
i32:int;
i64:long;
u8:ubyte;
u16:ushort;
u32:uint;
u64:ulong;
f:float;
d:double;
ei8:ByteEnum;
ei16:ShortEnum;
ei32:IntEnum;
ei64:LongEnum;
eu8:UByteEnum;
eu16:UShortEnum;
eu32:UIntEnum;
eu64:ULongEnum;
s:BoolStruct;
a_b:[bool:2];
a_i8:[byte:2];
a_i16:[short:2];
a_i32:[int:2];
a_i64:[long:2];
a_u8:[ubyte:2];
a_u16:[ushort:2];
a_u32:[uint:2];
a_u64:[ulong:2];
a_f:[float:2];
a_d:[double:2];
a_ei8:[ByteEnum:2];
a_ei16:[ShortEnum:2];
a_ei32:[IntEnum:2];
a_ei64:[LongEnum:2];
a_eu8:[UByteEnum:2];
a_eu16:[UShortEnum:2];
a_eu32:[UIntEnum:2];
a_eu64:[ULongEnum:2];
a_s:[BoolStruct:2];
}
table BoolTable {
b:bool;
}
table StringTable {
str:string;
}
union Union {
BoolTable,
StringTable,
BoolStruct,
}
table UnionTable {
u:Union;
}
table DefaultTable {
b:bool;
i8:byte;
i16:short;
i32:int;
i64:long;
u8:ubyte;
u16:ushort;
u32:uint;
u64:ulong;
f:float;
d:double;
str:string;
ei8:ByteEnum;
ei16:ShortEnum;
ei32:IntEnum;
ei64:LongEnum;
eu8:UByteEnum;
eu16:UShortEnum;
eu32:UIntEnum;
eu64:ULongEnum;
t:BoolTable;
u:Union;
s:DefaultStruct;
v_b:[bool];
v_i8:[byte];
v_i16:[short];
v_i32:[int];
v_i64:[long];
v_u8:[ubyte];
v_u16:[ushort];
v_u32:[uint];
v_u64:[ulong];
v_f:[float];
v_d:[double];
v_str:[string];
v_ei8:[ByteEnum];
v_ei16:[ShortEnum];
v_ei32:[IntEnum];
v_ei64:[LongEnum];
v_eu8:[UByteEnum];
v_eu16:[UShortEnum];
v_eu32:[UIntEnum];
v_eu64:[ULongEnum];
v_t:[BoolTable];
v_u:[Union];
v_s:[DefaultStruct];
}
table OptionalTable {
b:bool = null;
i8:byte = null;
i16:short = null;
i32:int = null;
i64:long = null;
u8:ubyte = null;
u16:ushort = null;
u32:uint = null;
u64:ulong = null;
f:float = null;
d:double = null;
str:string; // always optional, no need to specify the default value.
ei8:ByteEnum = null;
ei16:ShortEnum = null;
ei32:IntEnum = null;
ei64:LongEnum = null;
eu8:UByteEnum = null;
eu16:UShortEnum = null;
eu32:UIntEnum = null;
eu64:ULongEnum = null;
t:BoolTable;
u:Union;
s:DefaultStruct;
v_b:[bool];
v_i8:[byte];
v_i16:[short];
v_i32:[int];
v_i64:[long];
v_u8:[ubyte];
v_u16:[ushort];
v_u32:[uint];
v_u64:[ulong];
v_f:[float];
v_d:[double];
v_str:[string];
v_ei8:[ByteEnum];
v_ei16:[ShortEnum];
v_ei32:[IntEnum];
v_ei64:[LongEnum];
v_eu8:[UByteEnum];
v_eu16:[UShortEnum];
v_eu32:[UIntEnum];
v_eu64:[ULongEnum];
v_t:[BoolTable];
v_u:[Union];
v_s:[DefaultStruct];
}
table RequiredTable {
str:string (required);
t:BoolTable (required);
u:Union (required);
s:DefaultStruct (required);
v_b:[bool] (required);
v_i8:[byte] (required);
v_i16:[short] (required);
v_i32:[int] (required);
v_i64:[long] (required);
v_u8:[ubyte] (required);
v_u16:[ushort] (required);
v_u32:[uint] (required);
v_u64:[ulong] (required);
v_f:[float] (required);
v_d:[double] (required);
v_str:[string] (required);
v_ei8:[ByteEnum] (required);
v_ei16:[ShortEnum] (required);
v_ei32:[IntEnum] (required);
v_ei64:[LongEnum] (required);
v_eu8:[UByteEnum] (required);
v_eu16:[UShortEnum] (required);
v_eu32:[UIntEnum] (required);
v_eu64:[ULongEnum] (required);
v_t:[BoolTable] (required);
v_u:[Union] (required);
v_s:[DefaultStruct] (required);
}
table RecursiveTable {
t:NestedRecursiveTable;
}
table NestedRecursiveTable {
t:RecursiveTable;
}
root_type DefaultTable;