Skip to content

Commit

Permalink
Add Tests for LumiCore 64 and little refactoring for Testing Binarys
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-dmxc committed Nov 27, 2024
1 parent cca8520 commit c6190a6
Show file tree
Hide file tree
Showing 19 changed files with 163 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ public readonly struct PortTestSubject
public readonly object OutputUniverse;
public readonly object InputUniverse;

public PortTestSubject(EPortType portType, Universe outputUniverse, Universe inputUniverse)
public PortTestSubject(EPortType portType, Address outputUniverse, Address inputUniverse)
{
PortType = portType;
OutputUniverse = outputUniverse;
InputUniverse = inputUniverse;
}
public PortTestSubject(EPortType portType, Address outputUniverse, Address inputUniverse)
public PortTestSubject(EPortType portType, PortAddress outputUniverse, PortAddress inputUniverse)
{
PortType = portType;
OutputUniverse = outputUniverse;
Expand Down
18 changes: 16 additions & 2 deletions ArtNetTests/Binary Tests/ArtPollReplyBinaryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,22 @@ public void TestAll()
string portString = $"PortIndex: {port}";
var config = testSubject.Ports[port];
Assert.That(artPollReply.PortTypes[port], Is.EqualTo(config.PortType), portString);
Assert.That(artPollReply.OutputUniverses[port], Is.EqualTo(config.OutputUniverse), portString);
Assert.That(artPollReply.InputUniverses[port], Is.EqualTo(config.InputUniverse), portString);
if (artPollReply.Status.PortAddressBitResolution == NodeStatus.EPortAddressBitResolution._8Bit)
{
Assert.That(artPollReply.OutputUniverses[port], Is.EqualTo(config.OutputUniverse), portString);
Assert.That(artPollReply.InputUniverses[port], Is.EqualTo(config.InputUniverse), portString);
}
else if (artPollReply.OutputUniverses[port] is Universe outputUniverse && artPollReply.InputUniverses[port] is Universe inputUniverse)
{
PortAddress outputPort = new PortAddress(artPollReply.Net, artPollReply.Subnet, outputUniverse);
PortAddress inputPort = new PortAddress(artPollReply.Net, artPollReply.Subnet, inputUniverse);
Assert.That(outputPort, Is.EqualTo(config.OutputUniverse), portString);
Assert.That(inputPort, Is.EqualTo(config.InputUniverse), portString);
}
else
{
Assert.Fail("Not implementet this case");
}
}
if (testSubject.NodeReport.HasValue)
Assert.That(artPollReply.NodeReport, Is.EqualTo(testSubject.NodeReport.Value));
Expand Down
2 changes: 1 addition & 1 deletion ArtNetTests/Binary Tests/Astera/Astera_Titan_PowerBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ internal class Astera_Titan_PowerBox : AbstractArtPollReplyBinaryTestSubject

private static readonly PortTestSubject[] PORTS =
[
new PortTestSubject(EPortType.OutputFromArtNet,(Universe)14,(Universe)0)
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)14,(PortAddress)0)
];
public Astera_Titan_PowerBox() : base(
"Astera Titan PowerBox (FW 1.21)",
Expand Down
8 changes: 4 additions & 4 deletions ArtNetTests/Binary Tests/DMXControl/DMXControl3_SW_3_2_3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ internal class DMXControl3_SW_3_2_3 : AbstractArtPollReplyBinaryTestSubject

private static readonly PortTestSubject[] PORTS =
[
new PortTestSubject(EPortType.InputToArtNet | EPortType.OutputFromArtNet,(Universe)4,(Universe)0),
new PortTestSubject(EPortType.InputToArtNet | EPortType.OutputFromArtNet,(Universe)5,(Universe)1),
new PortTestSubject(EPortType.InputToArtNet | EPortType.OutputFromArtNet,(Universe)6,(Universe)2),
new PortTestSubject(EPortType.InputToArtNet | EPortType.OutputFromArtNet,(Universe)7,(Universe)3)
new PortTestSubject(EPortType.InputToArtNet | EPortType.OutputFromArtNet,(PortAddress)4,(PortAddress)0),
new PortTestSubject(EPortType.InputToArtNet | EPortType.OutputFromArtNet,(PortAddress)5,(PortAddress)1),
new PortTestSubject(EPortType.InputToArtNet | EPortType.OutputFromArtNet,(PortAddress)6,(PortAddress)2),
new PortTestSubject(EPortType.InputToArtNet | EPortType.OutputFromArtNet,(PortAddress)7,(PortAddress)3)
];
public DMXControl3_SW_3_2_3() : base(
"DMXControl 3 (3.2.3)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ internal class Elation_Obisdian_RDM10_2_9_2 : AbstractArtPollReplyBinaryTestSubj

private static readonly PortTestSubject[] PORTS =
[
new PortTestSubject(EPortType.OutputFromArtNet,(Universe)0,(Universe)0)
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)0,(PortAddress)0)
];
public Elation_Obisdian_RDM10_2_9_2() : base(
"Elation Obsidian RDM10 (FW 2.9.2)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ internal class Elation_Obisdian_RDM10_2_9_3 : AbstractArtPollReplyBinaryTestSubj

private static readonly PortTestSubject[] PORTS =
[
new PortTestSubject(EPortType.OutputFromArtNet,(Universe)0,(Universe)0)
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)0,(PortAddress)0)
];
public Elation_Obisdian_RDM10_2_9_3() : base(
"Elation Obsidian RDM10 (FW 2.9.3)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ internal class Elation_Obisdian_RDM10_2_9_4 : AbstractArtPollReplyBinaryTestSubj

private static readonly PortTestSubject[] PORTS =
[
new PortTestSubject(EPortType.InputToArtNet,(Universe)0,(Universe)0)
new PortTestSubject(EPortType.InputToArtNet,(PortAddress)0,(PortAddress)0)
];
public Elation_Obisdian_RDM10_2_9_4() : base(
"Elation Obsidian RDM10 (FW 2.9.4)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ internal class Entec_Din_Ethergate_2_FW_2_1 : AbstractArtPollReplyBinaryTestSubj

private static readonly PortTestSubject[] PORTS =
[
new PortTestSubject(EPortType.OutputFromArtNet,(Universe)0,(Universe)0)
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)0,(PortAddress)0)
];
public Entec_Din_Ethergate_2_FW_2_1() : base(
"ENTEC DIN Ethergate 2 (FW 2.1)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ internal class Entec_Din_Ethergate_2_FW_2_5 : AbstractArtPollReplyBinaryTestSubj

private static readonly PortTestSubject[] PORTS =
[
new PortTestSubject(EPortType.OutputFromArtNet,(Universe)0,(Universe)0)
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)0,(PortAddress)0)
];
public Entec_Din_Ethergate_2_FW_2_5() : base(
"ENTEC DIN Ethergate 2 (FW 2.5)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ internal class LumenRadio_Stardust_1_1_1 : AbstractArtPollReplyBinaryTestSubject

private static readonly PortTestSubject[] PORTS =
[
new PortTestSubject(EPortType.DMX512,(Universe)15,(Universe)0)
new PortTestSubject(EPortType.DMX512,(PortAddress)32767,(PortAddress)32752)
];
public LumenRadio_Stardust_1_1_1() : base(
"LumenRadio Stardust (FW 1.1.1)",
Expand Down
62 changes: 62 additions & 0 deletions ArtNetTests/Binary Tests/Luminex/Luminex_LumiCore64_2_6_1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using ArtNetSharp;

namespace ArtNetTests.Binary_Tests.Luminex
{
internal class Luminex_LumiCore64_2_6_1 : AbstractArtPollReplyBinaryTestSubject
{
private static readonly byte[] DATA = [
0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00,
0x00, 0x21, 0x02, 0x22, 0x02, 0x96, 0x36, 0x19,
0x02, 0x06, 0x00, 0x01, 0x2a, 0x57, 0x00, 0xe3,
0x4c, 0x4c, 0x4c, 0x75, 0x6d, 0x69, 0x43, 0x6f,
0x72, 0x65, 0x20, 0x36, 0x34, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x4c, 0x75, 0x6d, 0x69,
0x43, 0x6f, 0x72, 0x65, 0x20, 0x36, 0x34, 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, 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, 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, 0x00, 0x01, 0x80, 0x00,
0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xd0, 0x69, 0x9e, 0xa1, 0x02, 0x96, 0x02,
0x22, 0x02, 0x96, 0x1a, 0x19, 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 ];

private static readonly PortTestSubject[] PORTS =
[
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)25,(PortAddress)16)
];
public Luminex_LumiCore64_2_6_1() : base(
"Luminex LumiCore 64 (FW 2.6.1)",
DATA,
0,
"LumiCore 64",
"LumiCore 64",
new MACAddress("d0:69:9e:a1:02:96"),
new IPv4Address("2.34.2.150"),
new IPv4Address("2.34.2.150"),
0x2a57,
0x4c4c,
EStCodes.StNode,
PORTS,
true,
majorVersion:2,
minorVersion:6)
{
}
}
}
62 changes: 62 additions & 0 deletions ArtNetTests/Binary Tests/Luminex/Luminex_LumiCore64_2_6_2.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using ArtNetSharp;

namespace ArtNetTests.Binary_Tests.Luminex
{
internal class Luminex_LumiCore64_2_6_2 : AbstractArtPollReplyBinaryTestSubject
{
private static readonly byte[] DATA = [
0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00,
0x00, 0x21, 0x02, 0x22, 0x02, 0x96, 0x36, 0x19,
0x02, 0x06, 0x00, 0x03, 0x2a, 0x57, 0x00, 0xe3,
0x4c, 0x4c, 0x4c, 0x75, 0x6d, 0x69, 0x43, 0x6f,
0x72, 0x65, 0x20, 0x36, 0x34, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x4c, 0x75, 0x6d, 0x69,
0x43, 0x6f, 0x72, 0x65, 0x20, 0x36, 0x34, 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, 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, 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, 0x00, 0x01, 0x80, 0x00,
0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xd0, 0x69, 0x9e, 0xa1, 0x02, 0x96, 0x02,
0x22, 0x02, 0x96, 0x40, 0x19, 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 ];

private static readonly PortTestSubject[] PORTS =
[
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)63,(PortAddress)48)
];
public Luminex_LumiCore64_2_6_2() : base(
"Luminex LumiCore 64 (FW 2.6.2)",
DATA,
0,
"LumiCore 64",
"LumiCore 64",
new MACAddress("d0:69:9e:a1:02:96"),
new IPv4Address("2.34.2.150"),
new IPv4Address("2.34.2.150"),
0x2a57,
0x4c4c,
EStCodes.StNode,
PORTS,
true,
majorVersion:2,
minorVersion:6)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ internal class Luminex_LumiNode12_2_6_2 : AbstractArtPollReplyBinaryTestSubject

private static readonly PortTestSubject[] PORTS =
[
new PortTestSubject(EPortType.OutputFromArtNet,(Universe)4,(Universe)0)
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)20,(PortAddress)16)
];
public Luminex_LumiNode12_2_6_2() : base(
"Luminex LumiNode 12 (FW 2.6.2)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ internal class Luminex_LumiNode1_2_6_0 : AbstractArtPollReplyBinaryTestSubject

private static readonly PortTestSubject[] PORTS =
[
new PortTestSubject(EPortType.OutputFromArtNet,(Universe)0,(Universe)0)
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)0,(PortAddress)0)
];
public Luminex_LumiNode1_2_6_0() : base(
"Luminex LumiNode 1 (FW 2.6.0)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ internal class Luminex_LumiNode4_2_6_2 : AbstractArtPollReplyBinaryTestSubject

private static readonly PortTestSubject[] PORTS =
[
new PortTestSubject(EPortType.OutputFromArtNet,(Universe)13,(Universe)0)
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)13,(PortAddress)0)
];
public Luminex_LumiNode4_2_6_2() : base(
"Luminex LumiNode 4 (FW 2.6.2)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ internal class MA_Lighting_MA3_2_0_2_0 : AbstractArtPollReplyBinaryTestSubject

private static readonly PortTestSubject[] PORTS =
[
new PortTestSubject(EPortType.DMX512,(Universe)0,(Universe)0),
new PortTestSubject(EPortType.DMX512,(Universe)0,(Universe)0),
new PortTestSubject(EPortType.DMX512,(Universe)0,(Universe)0),
new PortTestSubject(EPortType.DMX512,(Universe)0,(Universe)0)
new PortTestSubject(EPortType.DMX512,(PortAddress)0,(PortAddress)0),
new PortTestSubject(EPortType.DMX512,(PortAddress)0,(PortAddress)0),
new PortTestSubject(EPortType.DMX512,(PortAddress)0,(PortAddress)0),
new PortTestSubject(EPortType.DMX512,(PortAddress)0,(PortAddress)0)
];
/// <summary>
/// Among the worst implementation of ArtNet I've ever seen 🙈😅
Expand Down
2 changes: 1 addition & 1 deletion ArtNetTests/Binary Tests/Pknight/Pknight_CR011R.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ internal class Pknight_CR011R : AbstractArtPollReplyBinaryTestSubject

private static readonly PortTestSubject[] PORTS =
[
new PortTestSubject(EPortType.OutputFromArtNet,(Universe)0,(Universe)0)
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)0,(PortAddress)0)
];
public Pknight_CR011R() : base(
"Pknight CR011R",
Expand Down
2 changes: 1 addition & 1 deletion ArtNetTests/Binary Tests/Showtec/Showtec_Net2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ internal class Showtec_Net2 : AbstractArtPollReplyBinaryTestSubject

private static readonly PortTestSubject[] PORTS =
[
new PortTestSubject(EPortType.OutputFromArtNet,(Universe)3,(Universe)3)
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)259,(PortAddress)259)
];
public Showtec_Net2() : base(
"Showtec Net2 (FW 1.2)",
Expand Down
2 changes: 1 addition & 1 deletion ArtNetTests/Binary Tests/Showtec/Showtec_Net8.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ internal class Showtec_Net8 : AbstractArtPollReplyBinaryTestSubject

private static readonly PortTestSubject[] PORTS =
[
new PortTestSubject(EPortType.OutputFromArtNet,(Universe)1,(Universe)1)
new PortTestSubject(EPortType.OutputFromArtNet,(PortAddress)1,(PortAddress)1)
];
public Showtec_Net8() : base(
"Showtec Net8 (FW 1.6)",
Expand Down

0 comments on commit c6190a6

Please sign in to comment.