mirror of
https://github.com/jwetzell/osc-go.git
synced 2026-07-26 10:28:42 +00:00
more tests for bad arg parsing
This commit is contained in:
@@ -467,6 +467,34 @@ func TestBadOSCMessageDecoding(t *testing.T) {
|
||||
},
|
||||
errorString: "OSC blob arg size not valid: size specified is larger than remaining bytes",
|
||||
},
|
||||
{
|
||||
name: "color arg not 4 bytes",
|
||||
bytes: []byte{
|
||||
47, 104, 101, 108, 108, 111, 0, 0, 44, 114, 0, 0, 20, 21,
|
||||
},
|
||||
errorString: "OSC color arg is not 4 bytes",
|
||||
},
|
||||
{
|
||||
name: "time tag arg seconds not complete",
|
||||
bytes: []byte{
|
||||
47, 104, 101, 108, 108, 111, 0, 0, 44, 116, 0, 0, 0,
|
||||
},
|
||||
errorString: "OSC time tag seconds are not valid: OSC int32 arg is not 4 bytes",
|
||||
},
|
||||
{
|
||||
name: "time tag arg fractional seconds not complete",
|
||||
bytes: []byte{
|
||||
47, 104, 101, 108, 108, 111, 0, 0, 44, 116, 0, 0, 0, 32, 0, 0, 0,
|
||||
},
|
||||
errorString: "OSC time tag fractional seconds are not valid: OSC int32 arg is not 4 bytes",
|
||||
},
|
||||
{
|
||||
name: "unknown arg type",
|
||||
bytes: []byte{
|
||||
47, 104, 101, 108, 108, 111, 0, 0, 44, 120, 0, 0,
|
||||
},
|
||||
errorString: "unsupported OSC argument type: x",
|
||||
},
|
||||
}
|
||||
|
||||
for _, testCase := range testCases {
|
||||
|
||||
Reference in New Issue
Block a user