mirror of
https://github.com/jwetzell/osc-go.git
synced 2026-09-01 03:29:00 +00:00
Merge pull request #18 from jwetzell/more-bad-tests
fill out some more error tests for messages
This commit is contained in:
@@ -290,6 +290,26 @@ func TestBadOSCMessageDecoding(t *testing.T) {
|
|||||||
bytes: []byte{},
|
bytes: []byte{},
|
||||||
errorString: "cannot create OSC Message from empty byte array",
|
errorString: "cannot create OSC Message from empty byte array",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "does not start with /",
|
||||||
|
bytes: []byte{0, 104, 101, 108, 108, 111, 0, 0},
|
||||||
|
errorString: "OSC Message must start with /",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "address string not padded",
|
||||||
|
bytes: []byte{47, 104, 101, 108, 108, 111, 0},
|
||||||
|
errorString: "string data is not properly padded",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "type string not padded",
|
||||||
|
bytes: []byte{47, 104, 101, 108, 108, 111, 0, 0, 44, 0},
|
||||||
|
errorString: "string data is not properly padded",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "type string does not start with ,",
|
||||||
|
bytes: []byte{47, 104, 101, 108, 108, 111, 0, 0, 45, 0, 0, 0},
|
||||||
|
errorString: "type string is malformed",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, testCase := range testCases {
|
for _, testCase := range testCases {
|
||||||
|
|||||||
Reference in New Issue
Block a user