mirror of
https://github.com/jwetzell/artnet-go.git
synced 2026-08-31 19:38:58 +00:00
remove constants from packet structs
This commit is contained in:
+54
-126
@@ -17,234 +17,162 @@ func TestGoodArtTodRequestUnmarshal(t *testing.T) {
|
||||
Name: "ACT Packet 1",
|
||||
Data: []byte{0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00, 0x00, 0x80, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
Expected: &artnet.ArtTodRequest{
|
||||
ID: artnet.ArtNetID,
|
||||
OpCode: artnet.OpTodRequest,
|
||||
ProtVerHi: 0x00,
|
||||
ProtVerLo: 0x0e,
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x00},
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x00},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "ACT Packet 2",
|
||||
Data: []byte{0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00, 0x00, 0x80, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
Expected: &artnet.ArtTodRequest{
|
||||
ID: artnet.ArtNetID,
|
||||
OpCode: artnet.OpTodRequest,
|
||||
ProtVerHi: 0x00,
|
||||
ProtVerLo: 0x0e,
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "ACT Packet 3",
|
||||
Data: []byte{0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00, 0x00, 0x80, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
Expected: &artnet.ArtTodRequest{
|
||||
ID: artnet.ArtNetID,
|
||||
OpCode: artnet.OpTodRequest,
|
||||
ProtVerHi: 0x00,
|
||||
ProtVerLo: 0x0e,
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "ACT Packet 4",
|
||||
Data: []byte{0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00, 0x00, 0x80, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
Expected: &artnet.ArtTodRequest{
|
||||
ID: artnet.ArtNetID,
|
||||
OpCode: artnet.OpTodRequest,
|
||||
ProtVerHi: 0x00,
|
||||
ProtVerLo: 0x0e,
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "ACT Packet 5",
|
||||
Data: []byte{0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00, 0x00, 0x80, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
Expected: &artnet.ArtTodRequest{
|
||||
ID: artnet.ArtNetID,
|
||||
OpCode: artnet.OpTodRequest,
|
||||
ProtVerHi: 0x00,
|
||||
ProtVerLo: 0x0e,
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "ACT Packet 6",
|
||||
Data: []byte{0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00, 0x00, 0x80, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
Expected: &artnet.ArtTodRequest{
|
||||
ID: artnet.ArtNetID,
|
||||
OpCode: artnet.OpTodRequest,
|
||||
ProtVerHi: 0x00,
|
||||
ProtVerLo: 0x0e,
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "ACT Packet 7",
|
||||
Data: []byte{0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00, 0x00, 0x80, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
Expected: &artnet.ArtTodRequest{
|
||||
ID: artnet.ArtNetID,
|
||||
OpCode: artnet.OpTodRequest,
|
||||
ProtVerHi: 0x00,
|
||||
ProtVerLo: 0x0e,
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "ACT Packet 8",
|
||||
Data: []byte{0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00, 0x00, 0x80, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
Expected: &artnet.ArtTodRequest{
|
||||
ID: artnet.ArtNetID,
|
||||
OpCode: artnet.OpTodRequest,
|
||||
ProtVerHi: 0x00,
|
||||
ProtVerLo: 0x0e,
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "ACT Packet 9",
|
||||
Data: []byte{0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00, 0x00, 0x80, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
Expected: &artnet.ArtTodRequest{
|
||||
ID: artnet.ArtNetID,
|
||||
OpCode: artnet.OpTodRequest,
|
||||
ProtVerHi: 0x00,
|
||||
ProtVerLo: 0x0e,
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "ACT Packet 10",
|
||||
Data: []byte{0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00, 0x00, 0x80, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
Expected: &artnet.ArtTodRequest{
|
||||
ID: artnet.ArtNetID,
|
||||
OpCode: artnet.OpTodRequest,
|
||||
ProtVerHi: 0x00,
|
||||
ProtVerLo: 0x0e,
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "ACT Packet 11",
|
||||
Data: []byte{0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00, 0x00, 0x80, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
Expected: &artnet.ArtTodRequest{
|
||||
ID: artnet.ArtNetID,
|
||||
OpCode: artnet.OpTodRequest,
|
||||
ProtVerHi: 0x00,
|
||||
ProtVerLo: 0x0e,
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "ACT Packet 12",
|
||||
Data: []byte{0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00, 0x00, 0x80, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
Expected: &artnet.ArtTodRequest{
|
||||
ID: artnet.ArtNetID,
|
||||
OpCode: artnet.OpTodRequest,
|
||||
ProtVerHi: 0x00,
|
||||
ProtVerLo: 0x0e,
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "ACT Packet 13",
|
||||
Data: []byte{0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00, 0x00, 0x80, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
Expected: &artnet.ArtTodRequest{
|
||||
ID: artnet.ArtNetID,
|
||||
OpCode: artnet.OpTodRequest,
|
||||
ProtVerHi: 0x00,
|
||||
ProtVerLo: 0x0e,
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "ACT Packet 14",
|
||||
Data: []byte{0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00, 0x00, 0x80, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
Expected: &artnet.ArtTodRequest{
|
||||
ID: artnet.ArtNetID,
|
||||
OpCode: artnet.OpTodRequest,
|
||||
ProtVerHi: 0x00,
|
||||
ProtVerLo: 0x0e,
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "ACT Packet 15",
|
||||
Data: []byte{0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00, 0x00, 0x80, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
Expected: &artnet.ArtTodRequest{
|
||||
ID: artnet.ArtNetID,
|
||||
OpCode: artnet.OpTodRequest,
|
||||
ProtVerHi: 0x00,
|
||||
ProtVerLo: 0x0e,
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "ACT Packet 16",
|
||||
Data: []byte{0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00, 0x00, 0x80, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
Expected: &artnet.ArtTodRequest{
|
||||
ID: artnet.ArtNetID,
|
||||
OpCode: artnet.OpTodRequest,
|
||||
ProtVerHi: 0x00,
|
||||
ProtVerLo: 0x0e,
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "ACT Packet 17",
|
||||
Data: []byte{0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00, 0x00, 0x80, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
Expected: &artnet.ArtTodRequest{
|
||||
ID: artnet.ArtNetID,
|
||||
OpCode: artnet.OpTodRequest,
|
||||
ProtVerHi: 0x00,
|
||||
ProtVerLo: 0x0e,
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "ACT Packet 18",
|
||||
Data: []byte{0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00, 0x00, 0x80, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
Expected: &artnet.ArtTodRequest{
|
||||
ID: artnet.ArtNetID,
|
||||
OpCode: artnet.OpTodRequest,
|
||||
ProtVerHi: 0x00,
|
||||
ProtVerLo: 0x0e,
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
Command: artnet.TodFull,
|
||||
Net: 0x00,
|
||||
Address: []uint8{0x10},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user