Skip to content

Commit c6190a6

Browse files
committedNov 27, 2024·
Add Tests for LumiCore 64 and little refactoring for Testing Binarys
1 parent cca8520 commit c6190a6

19 files changed

+163
-25
lines changed
 

‎ArtNetTests/Binary Tests/AbstractArtPollReplyBinaryTestSubject.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ public readonly struct PortTestSubject
9090
public readonly object OutputUniverse;
9191
public readonly object InputUniverse;
9292

93-
public PortTestSubject(EPortType portType, Universe outputUniverse, Universe inputUniverse)
93+
public PortTestSubject(EPortType portType, Address outputUniverse, Address inputUniverse)
9494
{
9595
PortType = portType;
9696
OutputUniverse = outputUniverse;
9797
InputUniverse = inputUniverse;
9898
}
99-
public PortTestSubject(EPortType portType, Address outputUniverse, Address inputUniverse)
99+
public PortTestSubject(EPortType portType, PortAddress outputUniverse, PortAddress inputUniverse)
100100
{
101101
PortType = portType;
102102
OutputUniverse = outputUniverse;

‎ArtNetTests/Binary Tests/ArtPollReplyBinaryTests.cs

+16-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,22 @@ public void TestAll()
5454
string portString = $"PortIndex: {port}";
5555
var config = testSubject.Ports[port];
5656
Assert.That(artPollReply.PortTypes[port], Is.EqualTo(config.PortType), portString);
57-
Assert.That(artPollReply.OutputUniverses[port], Is.EqualTo(config.OutputUniverse), portString);
58-
Assert.That(artPollReply.InputUniverses[port], Is.EqualTo(config.InputUniverse), portString);
57+
if (artPollReply.Status.PortAddressBitResolution == NodeStatus.EPortAddressBitResolution._8Bit)
58+
{
59+
Assert.That(artPollReply.OutputUniverses[port], Is.EqualTo(config.OutputUniverse), portString);
60+
Assert.That(artPollReply.InputUniverses[port], Is.EqualTo(config.InputUniverse), portString);
61+
}
62+
else if (artPollReply.OutputUniverses[port] is Universe outputUniverse && artPollReply.InputUniverses[port] is Universe inputUniverse)
63+
{
64+
PortAddress outputPort = new PortAddress(artPollReply.Net, artPollReply.Subnet, outputUniverse);
65+
PortAddress inputPort = new PortAddress(artPollReply.Net, artPollReply.Subnet, inputUniverse);
66+
Assert.That(outputPort, Is.EqualTo(config.OutputUniverse), portString);
67+
Assert.That(inputPort, Is.EqualTo(config.InputUniverse), portString);
68+
}
69+
else
70+
{
71+
Assert.Fail("Not implementet this case");
72+
}
5973
}
6074
if (testSubject.NodeReport.HasValue)
6175
Assert.That(artPollReply.NodeReport, Is.EqualTo(testSubject.NodeReport.Value));

‎ArtNetTests/Binary Tests/Astera/Astera_Titan_PowerBox.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ internal class Astera_Titan_PowerBox : AbstractArtPollReplyBinaryTestSubject
3838

3939
private static readonly PortTestSubject[] PORTS =
4040
[
41-
new PortTestSubject(EPortType.OutputFromArtNet,(Universe)14,(Universe)0)
41+
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)14,(PortAddress)0)
4242
];
4343
public Astera_Titan_PowerBox() : base(
4444
"Astera Titan PowerBox (FW 1.21)",

‎ArtNetTests/Binary Tests/DMXControl/DMXControl3_SW_3_2_3.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ internal class DMXControl3_SW_3_2_3 : AbstractArtPollReplyBinaryTestSubject
3838

3939
private static readonly PortTestSubject[] PORTS =
4040
[
41-
new PortTestSubject(EPortType.InputToArtNet | EPortType.OutputFromArtNet,(Universe)4,(Universe)0),
42-
new PortTestSubject(EPortType.InputToArtNet | EPortType.OutputFromArtNet,(Universe)5,(Universe)1),
43-
new PortTestSubject(EPortType.InputToArtNet | EPortType.OutputFromArtNet,(Universe)6,(Universe)2),
44-
new PortTestSubject(EPortType.InputToArtNet | EPortType.OutputFromArtNet,(Universe)7,(Universe)3)
41+
new PortTestSubject(EPortType.InputToArtNet | EPortType.OutputFromArtNet,(PortAddress)4,(PortAddress)0),
42+
new PortTestSubject(EPortType.InputToArtNet | EPortType.OutputFromArtNet,(PortAddress)5,(PortAddress)1),
43+
new PortTestSubject(EPortType.InputToArtNet | EPortType.OutputFromArtNet,(PortAddress)6,(PortAddress)2),
44+
new PortTestSubject(EPortType.InputToArtNet | EPortType.OutputFromArtNet,(PortAddress)7,(PortAddress)3)
4545
];
4646
public DMXControl3_SW_3_2_3() : base(
4747
"DMXControl 3 (3.2.3)",

‎ArtNetTests/Binary Tests/Elation/Obsidian/Elation_Obisdian_RDM10_2_9_2.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ internal class Elation_Obisdian_RDM10_2_9_2 : AbstractArtPollReplyBinaryTestSubj
3838

3939
private static readonly PortTestSubject[] PORTS =
4040
[
41-
new PortTestSubject(EPortType.OutputFromArtNet,(Universe)0,(Universe)0)
41+
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)0,(PortAddress)0)
4242
];
4343
public Elation_Obisdian_RDM10_2_9_2() : base(
4444
"Elation Obsidian RDM10 (FW 2.9.2)",

‎ArtNetTests/Binary Tests/Elation/Obsidian/Elation_Obisdian_RDM10_2_9_3.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ internal class Elation_Obisdian_RDM10_2_9_3 : AbstractArtPollReplyBinaryTestSubj
3838

3939
private static readonly PortTestSubject[] PORTS =
4040
[
41-
new PortTestSubject(EPortType.OutputFromArtNet,(Universe)0,(Universe)0)
41+
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)0,(PortAddress)0)
4242
];
4343
public Elation_Obisdian_RDM10_2_9_3() : base(
4444
"Elation Obsidian RDM10 (FW 2.9.3)",

‎ArtNetTests/Binary Tests/Elation/Obsidian/Elation_Obisdian_RDM10_2_9_4.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ internal class Elation_Obisdian_RDM10_2_9_4 : AbstractArtPollReplyBinaryTestSubj
3838

3939
private static readonly PortTestSubject[] PORTS =
4040
[
41-
new PortTestSubject(EPortType.InputToArtNet,(Universe)0,(Universe)0)
41+
new PortTestSubject(EPortType.InputToArtNet,(PortAddress)0,(PortAddress)0)
4242
];
4343
public Elation_Obisdian_RDM10_2_9_4() : base(
4444
"Elation Obsidian RDM10 (FW 2.9.4)",

‎ArtNetTests/Binary Tests/Entec/Din Ethergate 2/Entec_Din_Ethergate_2_FW_2_1.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ internal class Entec_Din_Ethergate_2_FW_2_1 : AbstractArtPollReplyBinaryTestSubj
3838

3939
private static readonly PortTestSubject[] PORTS =
4040
[
41-
new PortTestSubject(EPortType.OutputFromArtNet,(Universe)0,(Universe)0)
41+
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)0,(PortAddress)0)
4242
];
4343
public Entec_Din_Ethergate_2_FW_2_1() : base(
4444
"ENTEC DIN Ethergate 2 (FW 2.1)",

‎ArtNetTests/Binary Tests/Entec/Din Ethergate 2/Entec_Din_Ethergate_2_FW_2_5.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ internal class Entec_Din_Ethergate_2_FW_2_5 : AbstractArtPollReplyBinaryTestSubj
3838

3939
private static readonly PortTestSubject[] PORTS =
4040
[
41-
new PortTestSubject(EPortType.OutputFromArtNet,(Universe)0,(Universe)0)
41+
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)0,(PortAddress)0)
4242
];
4343
public Entec_Din_Ethergate_2_FW_2_5() : base(
4444
"ENTEC DIN Ethergate 2 (FW 2.5)",

‎ArtNetTests/Binary Tests/LumenRadio/LumenRadio_Stardust_1_1_1.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ internal class LumenRadio_Stardust_1_1_1 : AbstractArtPollReplyBinaryTestSubject
3838

3939
private static readonly PortTestSubject[] PORTS =
4040
[
41-
new PortTestSubject(EPortType.DMX512,(Universe)15,(Universe)0)
41+
new PortTestSubject(EPortType.DMX512,(PortAddress)32767,(PortAddress)32752)
4242
];
4343
public LumenRadio_Stardust_1_1_1() : base(
4444
"LumenRadio Stardust (FW 1.1.1)",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
using ArtNetSharp;
2+
3+
namespace ArtNetTests.Binary_Tests.Luminex
4+
{
5+
internal class Luminex_LumiCore64_2_6_1 : AbstractArtPollReplyBinaryTestSubject
6+
{
7+
private static readonly byte[] DATA = [
8+
0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00,
9+
0x00, 0x21, 0x02, 0x22, 0x02, 0x96, 0x36, 0x19,
10+
0x02, 0x06, 0x00, 0x01, 0x2a, 0x57, 0x00, 0xe3,
11+
0x4c, 0x4c, 0x4c, 0x75, 0x6d, 0x69, 0x43, 0x6f,
12+
0x72, 0x65, 0x20, 0x36, 0x34, 0x00, 0x00, 0x00,
13+
0x00, 0x00, 0x00, 0x00, 0x4c, 0x75, 0x6d, 0x69,
14+
0x43, 0x6f, 0x72, 0x65, 0x20, 0x36, 0x34, 0x00,
15+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
16+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
17+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
18+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
19+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
20+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
21+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
22+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
23+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
24+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
25+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
26+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
27+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
28+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
29+
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00,
30+
0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x80, 0x00,
31+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00,
32+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
33+
0x00, 0xd0, 0x69, 0x9e, 0xa1, 0x02, 0x96, 0x02,
34+
0x22, 0x02, 0x96, 0x1a, 0x19, 0x00, 0x00, 0x00,
35+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
36+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
37+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ];
38+
39+
private static readonly PortTestSubject[] PORTS =
40+
[
41+
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)25,(PortAddress)16)
42+
];
43+
public Luminex_LumiCore64_2_6_1() : base(
44+
"Luminex LumiCore 64 (FW 2.6.1)",
45+
DATA,
46+
0,
47+
"LumiCore 64",
48+
"LumiCore 64",
49+
new MACAddress("d0:69:9e:a1:02:96"),
50+
new IPv4Address("2.34.2.150"),
51+
new IPv4Address("2.34.2.150"),
52+
0x2a57,
53+
0x4c4c,
54+
EStCodes.StNode,
55+
PORTS,
56+
true,
57+
majorVersion:2,
58+
minorVersion:6)
59+
{
60+
}
61+
}
62+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
using ArtNetSharp;
2+
3+
namespace ArtNetTests.Binary_Tests.Luminex
4+
{
5+
internal class Luminex_LumiCore64_2_6_2 : AbstractArtPollReplyBinaryTestSubject
6+
{
7+
private static readonly byte[] DATA = [
8+
0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00,
9+
0x00, 0x21, 0x02, 0x22, 0x02, 0x96, 0x36, 0x19,
10+
0x02, 0x06, 0x00, 0x03, 0x2a, 0x57, 0x00, 0xe3,
11+
0x4c, 0x4c, 0x4c, 0x75, 0x6d, 0x69, 0x43, 0x6f,
12+
0x72, 0x65, 0x20, 0x36, 0x34, 0x00, 0x00, 0x00,
13+
0x00, 0x00, 0x00, 0x00, 0x4c, 0x75, 0x6d, 0x69,
14+
0x43, 0x6f, 0x72, 0x65, 0x20, 0x36, 0x34, 0x00,
15+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
16+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
17+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
18+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
19+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
20+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
21+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
22+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
23+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
24+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
25+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
26+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
27+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
28+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
29+
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00,
30+
0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x80, 0x00,
31+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00,
32+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
33+
0x00, 0xd0, 0x69, 0x9e, 0xa1, 0x02, 0x96, 0x02,
34+
0x22, 0x02, 0x96, 0x40, 0x19, 0x00, 0x00, 0x00,
35+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
36+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
37+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ];
38+
39+
private static readonly PortTestSubject[] PORTS =
40+
[
41+
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)63,(PortAddress)48)
42+
];
43+
public Luminex_LumiCore64_2_6_2() : base(
44+
"Luminex LumiCore 64 (FW 2.6.2)",
45+
DATA,
46+
0,
47+
"LumiCore 64",
48+
"LumiCore 64",
49+
new MACAddress("d0:69:9e:a1:02:96"),
50+
new IPv4Address("2.34.2.150"),
51+
new IPv4Address("2.34.2.150"),
52+
0x2a57,
53+
0x4c4c,
54+
EStCodes.StNode,
55+
PORTS,
56+
true,
57+
majorVersion:2,
58+
minorVersion:6)
59+
{
60+
}
61+
}
62+
}

‎ArtNetTests/Binary Tests/Luminex/Luminex_LumiNode12_2_6_2.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ internal class Luminex_LumiNode12_2_6_2 : AbstractArtPollReplyBinaryTestSubject
3838

3939
private static readonly PortTestSubject[] PORTS =
4040
[
41-
new PortTestSubject(EPortType.OutputFromArtNet,(Universe)4,(Universe)0)
41+
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)20,(PortAddress)16)
4242
];
4343
public Luminex_LumiNode12_2_6_2() : base(
4444
"Luminex LumiNode 12 (FW 2.6.2)",

‎ArtNetTests/Binary Tests/Luminex/Luminex_LumiNode1_2_6_0.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ internal class Luminex_LumiNode1_2_6_0 : AbstractArtPollReplyBinaryTestSubject
3838

3939
private static readonly PortTestSubject[] PORTS =
4040
[
41-
new PortTestSubject(EPortType.OutputFromArtNet,(Universe)0,(Universe)0)
41+
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)0,(PortAddress)0)
4242
];
4343
public Luminex_LumiNode1_2_6_0() : base(
4444
"Luminex LumiNode 1 (FW 2.6.0)",

‎ArtNetTests/Binary Tests/Luminex/Luminex_LumiNode4_2_6_2.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ internal class Luminex_LumiNode4_2_6_2 : AbstractArtPollReplyBinaryTestSubject
3838

3939
private static readonly PortTestSubject[] PORTS =
4040
[
41-
new PortTestSubject(EPortType.OutputFromArtNet,(Universe)13,(Universe)0)
41+
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)13,(PortAddress)0)
4242
];
4343
public Luminex_LumiNode4_2_6_2() : base(
4444
"Luminex LumiNode 4 (FW 2.6.2)",

‎ArtNetTests/Binary Tests/MA-Lighting/MA_Lighting_MA3_2_0_2_0.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ internal class MA_Lighting_MA3_2_0_2_0 : AbstractArtPollReplyBinaryTestSubject
3838

3939
private static readonly PortTestSubject[] PORTS =
4040
[
41-
new PortTestSubject(EPortType.DMX512,(Universe)0,(Universe)0),
42-
new PortTestSubject(EPortType.DMX512,(Universe)0,(Universe)0),
43-
new PortTestSubject(EPortType.DMX512,(Universe)0,(Universe)0),
44-
new PortTestSubject(EPortType.DMX512,(Universe)0,(Universe)0)
41+
new PortTestSubject(EPortType.DMX512,(PortAddress)0,(PortAddress)0),
42+
new PortTestSubject(EPortType.DMX512,(PortAddress)0,(PortAddress)0),
43+
new PortTestSubject(EPortType.DMX512,(PortAddress)0,(PortAddress)0),
44+
new PortTestSubject(EPortType.DMX512,(PortAddress)0,(PortAddress)0)
4545
];
4646
/// <summary>
4747
/// Among the worst implementation of ArtNet I've ever seen 🙈😅

‎ArtNetTests/Binary Tests/Pknight/Pknight_CR011R.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ internal class Pknight_CR011R : AbstractArtPollReplyBinaryTestSubject
3535

3636
private static readonly PortTestSubject[] PORTS =
3737
[
38-
new PortTestSubject(EPortType.OutputFromArtNet,(Universe)0,(Universe)0)
38+
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)0,(PortAddress)0)
3939
];
4040
public Pknight_CR011R() : base(
4141
"Pknight CR011R",

‎ArtNetTests/Binary Tests/Showtec/Showtec_Net2.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ internal class Showtec_Net2 : AbstractArtPollReplyBinaryTestSubject
3838

3939
private static readonly PortTestSubject[] PORTS =
4040
[
41-
new PortTestSubject(EPortType.OutputFromArtNet,(Universe)3,(Universe)3)
41+
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)259,(PortAddress)259)
4242
];
4343
public Showtec_Net2() : base(
4444
"Showtec Net2 (FW 1.2)",

‎ArtNetTests/Binary Tests/Showtec/Showtec_Net8.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ internal class Showtec_Net8 : AbstractArtPollReplyBinaryTestSubject
3838

3939
private static readonly PortTestSubject[] PORTS =
4040
[
41-
new PortTestSubject(EPortType.OutputFromArtNet,(Universe)1,(Universe)1)
41+
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)1,(PortAddress)1)
4242
];
4343
public Showtec_Net8() : base(
4444
"Showtec Net8 (FW 1.6)",

0 commit comments

Comments
 (0)
Please sign in to comment.