From 2ec4be542698b7ef5ceb91d6f55e098b0e8c6fca Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Mon, 13 Apr 2026 22:51:52 -0500 Subject: [PATCH] more tests for bad arg parsing --- message_test.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/message_test.go b/message_test.go index 9777a98..1ffb987 100644 --- a/message_test.go +++ b/message_test.go @@ -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 {