mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-27 05:15:47 +00:00
add OSC encode/decode test with arg
This commit is contained in:
@@ -43,6 +43,19 @@ func TestGoodOSCMessageDecode(t *testing.T) {
|
|||||||
Args: []osc.OSCArg{},
|
Args: []osc.OSCArg{},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "basic OSC message with argument",
|
||||||
|
payload: []byte{47, 116, 101, 115, 116, 0, 0, 0, 44, 105, 0, 0, 0, 0, 0, 42},
|
||||||
|
expected: osc.OSCMessage{
|
||||||
|
Address: "/test",
|
||||||
|
Args: []osc.OSCArg{
|
||||||
|
{
|
||||||
|
Type: "i",
|
||||||
|
Value: int32(42),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
|||||||
@@ -42,6 +42,19 @@ func TestGoodOSCMessageEncode(t *testing.T) {
|
|||||||
},
|
},
|
||||||
expected: []byte{47, 116, 101, 115, 116, 0, 0, 0, 44, 0, 0, 0},
|
expected: []byte{47, 116, 101, 115, 116, 0, 0, 0, 44, 0, 0, 0},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "basic OSC message with argument",
|
||||||
|
payload: osc.OSCMessage{
|
||||||
|
Address: "/test",
|
||||||
|
Args: []osc.OSCArg{
|
||||||
|
{
|
||||||
|
Type: "i",
|
||||||
|
Value: int32(42),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
expected: []byte{47, 116, 101, 115, 116, 0, 0, 0, 44, 105, 0, 0, 0, 0, 0, 42},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
|||||||
Reference in New Issue
Block a user