mirror of
https://github.com/jwetzell/osc-go.git
synced 2026-09-02 20:19:01 +00:00
add test for nested bundle
This commit is contained in:
@@ -102,6 +102,31 @@ func TestGoodOSCBundleDecoding(t *testing.T) {
|
|||||||
47, 102, 114, 101, 113, 117, 101, 110, 99, 121, 0,
|
47, 102, 114, 101, 113, 117, 101, 110, 99, 121, 0,
|
||||||
44, 102, 0, 0, 67, 220, 0, 0},
|
44, 102, 0, 0, 67, 220, 0, 0},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "simple contents nested bundle",
|
||||||
|
expected: &OSCBundle{
|
||||||
|
TimeTag: OSCTimeTag{
|
||||||
|
seconds: 32,
|
||||||
|
fractionalSeconds: 0,
|
||||||
|
},
|
||||||
|
Contents: []OSCPacket{&OSCBundle{
|
||||||
|
TimeTag: OSCTimeTag{
|
||||||
|
seconds: 64,
|
||||||
|
fractionalSeconds: 0,
|
||||||
|
},
|
||||||
|
Contents: []OSCPacket{&OSCMessage{Address: "/oscillator/4/frequency", Args: []OSCArg{{Type: "f", Value: float32(440)}}}},
|
||||||
|
}},
|
||||||
|
},
|
||||||
|
bytes: []byte{35, 98, 117, 110, 100, 108, 101, 0, // #bundle
|
||||||
|
0, 0, 0, 32, 0, 0, 0, 0, // time tag
|
||||||
|
0, 0, 0, 52, // content size
|
||||||
|
35, 98, 117, 110, 100, 108, 101, 0, // #bundle
|
||||||
|
0, 0, 0, 64, 0, 0, 0, 0, // time tag
|
||||||
|
0, 0, 0, 32, // content size
|
||||||
|
47, 111, 115, 99, 105, 108, 108, 97, 116, 111, 114, 47, 52,
|
||||||
|
47, 102, 114, 101, 113, 117, 101, 110, 99, 121, 0,
|
||||||
|
44, 102, 0, 0, 67, 220, 0, 0},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, testCase := range testCases {
|
for _, testCase := range testCases {
|
||||||
|
|||||||
Reference in New Issue
Block a user