message-size-increase #3
@ -9,7 +9,7 @@ import tu "git.tebibyte.media/sashakoshka/hopp/internal/testutil"
|
|||||||
func TestEncodeAnyInt(test *testing.T) {
|
func TestEncodeAnyInt(test *testing.T) {
|
||||||
err := testEncodeAny(test, uint8(0xCA), LI.WithCN(0), tu.S(0xCA))
|
err := testEncodeAny(test, uint8(0xCA), LI.WithCN(0), tu.S(0xCA))
|
||||||
if err != nil { test.Fatal(err) }
|
if err != nil { test.Fatal(err) }
|
||||||
err = testEncodeAny(test, 400, LI.WithCN(3), tu.S(
|
err = testEncodeAny(test, 400, LSI.WithCN(3), tu.S(
|
||||||
0, 0, 0x1, 0x90,
|
0, 0, 0x1, 0x90,
|
||||||
))
|
))
|
||||||
if err != nil { test.Fatal(err) }
|
if err != nil { test.Fatal(err) }
|
||||||
@ -22,15 +22,16 @@ func TestEncodeAnyTable(test *testing.T) {
|
|||||||
0x0000: "hi!",
|
0x0000: "hi!",
|
||||||
0xFFFF: []uint16 { 0xBEE5, 0x7777 },
|
0xFFFF: []uint16 { 0xBEE5, 0x7777 },
|
||||||
0x1234: [][]uint16 { []uint16 { 0x5 }, []uint16 { 0x17, 0xAAAA} },
|
0x1234: [][]uint16 { []uint16 { 0x5 }, []uint16 { 0x17, 0xAAAA} },
|
||||||
}, KTV.WithCN(0), tu.S(5).AddVar(
|
0x2345: [][]int16 { []int16 { 0x5 }, []int16 { 0x17, -0xAAA } },
|
||||||
|
}, KTV.WithCN(0), tu.S(6).AddVar(
|
||||||
[]byte {
|
[]byte {
|
||||||
0xF3, 0xB9,
|
0xF3, 0xB9,
|
||||||
byte(LI.WithCN(3)),
|
byte(LSI.WithCN(3)),
|
||||||
0, 0, 0, 1,
|
0, 0, 0, 1,
|
||||||
},
|
},
|
||||||
[]byte {
|
[]byte {
|
||||||
0x01, 0x02,
|
0x01, 0x02,
|
||||||
byte(LI.WithCN(3)),
|
byte(LSI.WithCN(3)),
|
||||||
0, 0, 0, 2,
|
0, 0, 0, 2,
|
||||||
},
|
},
|
||||||
[]byte {
|
[]byte {
|
||||||
@ -52,6 +53,15 @@ func TestEncodeAnyTable(test *testing.T) {
|
|||||||
0, 0x17,
|
0, 0x17,
|
||||||
0xAA, 0xAA,
|
0xAA, 0xAA,
|
||||||
},
|
},
|
||||||
|
[]byte {
|
||||||
|
0x23, 0x45,
|
||||||
|
byte(OTA.WithCN(0)), 2, byte(OTA.WithCN(0)),
|
||||||
|
1, byte(LSI.WithCN(1)),
|
||||||
|
0, 0x5,
|
||||||
|
2, byte(LSI.WithCN(1)),
|
||||||
|
0, 0x17,
|
||||||
|
0xF5, 0x56,
|
||||||
|
},
|
||||||
))
|
))
|
||||||
if err != nil { test.Fatal(err) }
|
if err != nil { test.Fatal(err) }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user