|
|
|
@ -230,6 +230,26 @@ func TestGenerateRun(test *testing.T) {
|
|
|
|
Name: "NestedArray",
|
|
|
|
Name: "NestedArray",
|
|
|
|
Type: TypeArray { Element: TypeArray { Element: TypeInt { Bits: 8 } } },
|
|
|
|
Type: TypeArray { Element: TypeArray { Element: TypeInt { Bits: 8 } } },
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
protocol.Messages[0x0004] = Message {
|
|
|
|
|
|
|
|
Name: "Integers",
|
|
|
|
|
|
|
|
Type: TypeTableDefined {
|
|
|
|
|
|
|
|
Fields: map[uint16] Field {
|
|
|
|
|
|
|
|
0x0000: Field { Name: "U5", Type: TypeInt { Bits: 5 } },
|
|
|
|
|
|
|
|
0x0001: Field { Name: "U8", Type: TypeInt { Bits: 8 } },
|
|
|
|
|
|
|
|
0x0002: Field { Name: "U16", Type: TypeInt { Bits: 16 } },
|
|
|
|
|
|
|
|
0x0003: Field { Name: "U32", Type: TypeInt { Bits: 32 } },
|
|
|
|
|
|
|
|
0x0004: Field { Name: "U64", Type: TypeInt { Bits: 64 } },
|
|
|
|
|
|
|
|
0x0006: Field { Name: "I8", Type: TypeInt { Bits: 8, Signed: true } },
|
|
|
|
|
|
|
|
0x0007: Field { Name: "I16", Type: TypeInt { Bits: 16, Signed: true } },
|
|
|
|
|
|
|
|
0x0008: Field { Name: "I32", Type: TypeInt { Bits: 32, Signed: true } },
|
|
|
|
|
|
|
|
0x0009: Field { Name: "I64", Type: TypeInt { Bits: 64, Signed: true } },
|
|
|
|
|
|
|
|
0x000B: Field { Name: "NI8", Type: TypeInt { Bits: 8, Signed: true } },
|
|
|
|
|
|
|
|
0x000C: Field { Name: "NI16",Type: TypeInt { Bits: 16, Signed: true } },
|
|
|
|
|
|
|
|
0x000D: Field { Name: "NI32",Type: TypeInt { Bits: 32, Signed: true } },
|
|
|
|
|
|
|
|
0x000E: Field { Name: "NI64",Type: TypeInt { Bits: 64, Signed: true } },
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
protocol.Types["User"] = TypeTableDefined {
|
|
|
|
protocol.Types["User"] = TypeTableDefined {
|
|
|
|
Fields: map[uint16] Field {
|
|
|
|
Fields: map[uint16] Field {
|
|
|
|
0x0000: Field { Name: "Name", Type: TypeString { } },
|
|
|
|
0x0000: Field { Name: "Name", Type: TypeString { } },
|
|
|