Moved from MSTest to NUnit
All checks were successful
🚀 Pack skyscraper8 / make-zip (push) Successful in 6m10s
All checks were successful
🚀 Pack skyscraper8 / make-zip (push) Successful in 6m10s
This commit is contained in:
parent
1b01ed8553
commit
37a070b665
3
.gitignore
vendored
3
.gitignore
vendored
@ -135,3 +135,6 @@ imgui.ini
|
||||
/.vs/skyscraper8/CopilotIndices/17.14.1431.25910
|
||||
/.vs
|
||||
/skyscraper8/bin/Debug/satip
|
||||
/skyscraper8.Tests.NUnit/bin/Debug/net8.0
|
||||
/skyscraper8.Tests.NUnit/obj/Debug/net8.0
|
||||
/skyscraper8.Tests.NUnit/obj
|
||||
|
||||
3
skyscraper8.Tests.NUnit/GlobalUsings.cs
Normal file
3
skyscraper8.Tests.NUnit/GlobalUsings.cs
Normal file
@ -0,0 +1,3 @@
|
||||
global using NUnit.Framework;
|
||||
|
||||
[assembly: LevelOfParallelism(1)]
|
||||
@ -8,7 +8,7 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace skyscraper8.Tests {
|
||||
namespace skyscraper8.Tests.NUnit.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
@ -22,14 +22,14 @@ namespace skyscraper8.Tests {
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources1 {
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources1() {
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -39,7 +39,7 @@ namespace skyscraper8.Tests {
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("skyscraper8.Tests.Resources1", typeof(Resources1).Assembly);
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("skyscraper8.Tests.NUnit.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
@ -110,26 +110,6 @@ namespace skyscraper8.Tests {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] MultipartRegistrationResponseTest {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("MultipartRegistrationResponseTest", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] MultipartRegistrationResponseTest2 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("MultipartRegistrationResponseTest2", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
@ -160,6 +140,26 @@ namespace skyscraper8.Tests {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] T45_V4_MultipartRegistrationResponseTest {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("T45_V4_MultipartRegistrationResponseTest", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] T45_V4_MultipartRegistrationResponseTest2 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("T45_V4_MultipartRegistrationResponseTest2", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
@ -118,49 +118,49 @@
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="ModemCapabilitiesEncodingTest" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\ModemCapabilitiesEncodingTest.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="MultipartRegistrationResponseTest" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\T45_V4_MultipartRegistrationResponseTest.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="PushMacManagementMessage_Version4_Type45" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\PushMacManagementMessage_Version4_Type45.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="ranging_response_test" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\ranging_response_test.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="MultipartRegistrationResponseTest2" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\T45_V4_MultipartRegistrationResponseTest2.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="test-1packet-01" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\test-1packet-01.ts;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="test-2packets-02-03" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\test-2packets-02-03.ts;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="test-3packets-04-05-06" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\test-3packets-04-05-06.ts;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="TransmitChannelConfigurationObject" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\TransmitChannelConfigurationObject.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="UpstreamChannelDescriptorTest" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\UpstreamChannelDescriptorTest.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="Frame00001343_TSGS1_MIS000_SYNC001" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\Frame00001343_TSGS1_MIS000_SYNC001.bbf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="Frame00000008_TSGS1_MIS000_SYNC001" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\Frame00000008_TSGS1_MIS000_SYNC001.bbf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>..\Resources\Frame00000008_TSGS1_MIS000_SYNC001.bbf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="Frame00000012_TSGS1_MIS000_SYNC001" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\Frame00000012_TSGS1_MIS000_SYNC001.bbf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="sdpTest" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\sdpTest.sdp;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>..\Resources\Frame00000012_TSGS1_MIS000_SYNC001.bbf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="Frame00000357_TSGS1_MIS000_SYNC184" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\Frame00000357_TSGS1_MIS000_SYNC184.bbframe;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>..\Resources\Frame00000357_TSGS1_MIS000_SYNC184.bbframe;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="Frame00001343_TSGS1_MIS000_SYNC001" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Frame00001343_TSGS1_MIS000_SYNC001.bbf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="ModemCapabilitiesEncodingTest" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\ModemCapabilitiesEncodingTest.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="PushMacManagementMessage_Version4_Type45" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\PushMacManagementMessage_Version4_Type45.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="ranging_response_test" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\ranging_response_test.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="sdpTest" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\sdpTest.sdp;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="T45_V4_MultipartRegistrationResponseTest" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\T45_V4_MultipartRegistrationResponseTest.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="T45_V4_MultipartRegistrationResponseTest2" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\T45_V4_MultipartRegistrationResponseTest2.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="test-1packet-01" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\test-1packet-01.ts;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="test-2packets-02-03" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\test-2packets-02-03.ts;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="test-3packets-04-05-06" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\test-3packets-04-05-06.ts;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="TransmitChannelConfigurationObject" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\TransmitChannelConfigurationObject.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="UpstreamChannelDescriptorTest" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\UpstreamChannelDescriptorTest.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
||||
79
skyscraper8.Tests.NUnit/SkyscrapersTestingFramework.cs
Normal file
79
skyscraper8.Tests.NUnit/SkyscrapersTestingFramework.cs
Normal file
@ -0,0 +1,79 @@
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
|
||||
namespace skyscraper8.Tests.NUnit;
|
||||
|
||||
[NonParallelizable]
|
||||
public class SkyscrapersTestingFramework
|
||||
{
|
||||
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
|
||||
private static Guid? _sessionId;
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
if (_sessionId == null)
|
||||
{
|
||||
_sessionId = Guid.NewGuid();
|
||||
Console.WriteLine("New session: " + _sessionId);
|
||||
}
|
||||
Console.WriteLine("Setup");
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void TearDown()
|
||||
{
|
||||
Console.WriteLine("TearDown");
|
||||
|
||||
TestContext currentContext = TestContext.CurrentContext;
|
||||
}
|
||||
|
||||
public TException AssertTargetInvocation<TException>(TestDelegate action)
|
||||
where TException : Exception
|
||||
{
|
||||
TargetInvocationException exeption = Assert.Throws<TargetInvocationException>(action);
|
||||
|
||||
Assert.That(exeption.InnerException, Is.TypeOf<TException>());
|
||||
|
||||
return (TException)exeption.InnerException;
|
||||
}
|
||||
|
||||
private DirectoryInfo _samplesDirectory;
|
||||
private DirectoryInfo GetSamplesDirectory()
|
||||
{
|
||||
if (_samplesDirectory == null)
|
||||
{
|
||||
FileInfo fi = new FileInfo("sample_path.txt");
|
||||
if (!fi.Exists)
|
||||
{
|
||||
logger.WarnFormat("Could not find {0}", fi.FullName);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.InfoFormat("Reading samples path from: {0}", fi.FullName);
|
||||
string readAllText = File.ReadAllText(fi.FullName).Trim();
|
||||
_samplesDirectory = new DirectoryInfo(readAllText);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (_samplesDirectory == null)
|
||||
{
|
||||
Assert.Inconclusive("Could not find samples directory");
|
||||
}
|
||||
|
||||
return _samplesDirectory;
|
||||
}
|
||||
|
||||
protected FileStream GetStreamSample(string filename)
|
||||
{
|
||||
DirectoryInfo samplesDirectory = GetSamplesDirectory();
|
||||
FileInfo file = new FileInfo(Path.Combine(samplesDirectory.FullName, filename));
|
||||
if (!file.Exists)
|
||||
{
|
||||
Assert.Inconclusive(String.Format("Could not find sample file: {0}", file.FullName));
|
||||
}
|
||||
return file.OpenRead();
|
||||
}
|
||||
}
|
||||
30
skyscraper8.Tests.NUnit/TestLog4NetAppender.cs
Normal file
30
skyscraper8.Tests.NUnit/TestLog4NetAppender.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using log4net.Appender;
|
||||
using log4net.Core;
|
||||
|
||||
namespace skyscraper8.Tests.NUnit;
|
||||
|
||||
public class TestLog4NetAppender : AppenderSkeleton
|
||||
{
|
||||
private List<LoggingEvent> _events;
|
||||
|
||||
public IReadOnlyList<LoggingEvent> Events
|
||||
{
|
||||
get
|
||||
{
|
||||
return _events.AsReadOnly();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Append(LoggingEvent loggingEvent)
|
||||
{
|
||||
loggingEvent.Fix = FixFlags.All;
|
||||
if (_events == null)
|
||||
_events = new List<LoggingEvent>();
|
||||
_events.Add(loggingEvent);
|
||||
}
|
||||
|
||||
public string GetText()
|
||||
{
|
||||
return String.Join("\n", Events.Select(e => e.RenderedMessage));
|
||||
}
|
||||
}
|
||||
@ -1,28 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using log4net;
|
||||
using skyscraper5.Docsis;
|
||||
using skyscraper5.Docsis.AnnexC;
|
||||
using skyscraper5.Docsis.MacManagement;
|
||||
using skyscraper5.Docsis.MacManagement.BaselinePrivacyKeyManagementMessages;
|
||||
|
||||
namespace skyscraper8.Tests.RootTests;
|
||||
namespace skyscraper8.Tests.NUnit.Tests.CoverageTests;
|
||||
|
||||
[TestClass]
|
||||
public class DocsisTests : Feyllure
|
||||
[TestFixture]
|
||||
public class DocsisCoverageTests : SkyscrapersTestingFramework
|
||||
{
|
||||
[TestMethod]
|
||||
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
|
||||
|
||||
[Test]
|
||||
public void MacManagementMessageTypeAttributeTest()
|
||||
{
|
||||
MacManagementMessageTypeAttribute mmmta = new MacManagementMessageTypeAttribute(1, 2);
|
||||
Print(mmmta.ToString());
|
||||
logger.Info(mmmta.ToString());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void RcpIdEncodingTest()
|
||||
{
|
||||
RcpIdEncoding rie = new RcpIdEncoding(new byte[] { 7, 1, 0 });
|
||||
@ -31,7 +30,7 @@ public class DocsisTests : Feyllure
|
||||
Assert.Throws<NotImplementedException>(() => new RcpIdEncoding(new byte[] { 255, 1, 0 }));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void EthernetLlcPacketClassificationEncodingTest()
|
||||
{
|
||||
EthernetLlcPacketClassificationEncoding epce = new EthernetLlcPacketClassificationEncoding(new byte[] { 3, 3, 1, 0, 1 });
|
||||
@ -41,7 +40,7 @@ public class DocsisTests : Feyllure
|
||||
Assert.Throws<NotImplementedException>(() => new EthernetLlcPacketClassificationEncoding(new byte[] { 255, 1, 0 }));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void SimplifiedReceiveChannelAssignmentEncodingTest()
|
||||
{
|
||||
SimplifiedReceiveChannelAssignmentEncoding srcae =
|
||||
@ -52,7 +51,7 @@ public class DocsisTests : Feyllure
|
||||
Assert.Throws<NotImplementedException>(() => new SimplifiedReceiveChannelAssignmentEncoding(new byte[] { 254,0,1 }));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TransmitChannelConfigurationObjectTest()
|
||||
{
|
||||
CommonTlvEncodingObject.TransmitChannelConfigurationObject tcco =
|
||||
@ -83,7 +82,7 @@ public class DocsisTests : Feyllure
|
||||
new CommonTlvEncodingObject.TransmitChannelConfigurationObject(new byte[] { 254, 1, 0 }));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void CommonTlvEncodingObjectTest()
|
||||
{
|
||||
MemoryStream ms = new MemoryStream(new byte[]
|
||||
@ -109,7 +108,7 @@ public class DocsisTests : Feyllure
|
||||
Assert.Throws<NotImplementedException>(() => new CommonTlvEncodingObject(ms));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void GeneralPacketClassifierEncodingTest()
|
||||
{
|
||||
GeneralPacketClassifierEncoding gpce = new GeneralPacketClassifierEncoding(new byte[]
|
||||
@ -151,7 +150,7 @@ public class DocsisTests : Feyllure
|
||||
}));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void Ipv4PacketClassificationEncodingTest()
|
||||
{
|
||||
GeneralPacketClassifierEncoding.Ipv4PacketClassificationEncodings ipce =
|
||||
@ -184,7 +183,7 @@ public class DocsisTests : Feyllure
|
||||
}));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void ServiceFlowSidClusterAssignmentObjectTest()
|
||||
{
|
||||
ServiceFlowSidClusterAssignmentObject sfscao = new ServiceFlowSidClusterAssignmentObject(new byte[]
|
||||
@ -203,7 +202,7 @@ public class DocsisTests : Feyllure
|
||||
}));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void SidClusterEncodingObjectTest()
|
||||
{
|
||||
ServiceFlowSidClusterAssignmentObject.SidClusterEncodingObject sceo =
|
||||
@ -221,7 +220,7 @@ public class DocsisTests : Feyllure
|
||||
}));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void SidToChannelMappingObjectTest()
|
||||
{
|
||||
ServiceFlowSidClusterAssignmentObject.SidClusterEncodingObject.SidToChannelMappingObject stcmo =
|
||||
@ -242,7 +241,7 @@ public class DocsisTests : Feyllure
|
||||
}));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void Ipv6PacketClassificationEncodingTest()
|
||||
{
|
||||
byte[] buffer = new byte[]
|
||||
@ -262,7 +261,7 @@ public class DocsisTests : Feyllure
|
||||
Assert.AreEqual(0x0800, ipce.NextHeaderType);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void SidClusterSwitchoverCriteriaObjectTest()
|
||||
{
|
||||
byte[] buffer = new byte[]
|
||||
@ -284,7 +283,7 @@ public class DocsisTests : Feyllure
|
||||
new ServiceFlowSidClusterAssignmentObject.SidClusterSwitchoverCriteriaObject(buffer));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void ModemCapabilitiesEncodingTest()
|
||||
{
|
||||
byte[] buffer = new byte[]
|
||||
@ -489,7 +488,7 @@ public class DocsisTests : Feyllure
|
||||
Assert.Throws<NotImplementedException>(() => new ModemCapabilitiesEncoding(buffer));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void GeneralServiceFlowEncodingTest()
|
||||
{
|
||||
byte[] buffer = new byte[]
|
||||
@ -550,7 +549,7 @@ public class DocsisTests : Feyllure
|
||||
Assert.IsTrue(gsfe.DoNotUseRequest2ForRequests);
|
||||
Assert.IsTrue(gsfe.DoNotUsePriorityRequest);
|
||||
Assert.IsTrue(gsfe.DoNotUseAllCms);
|
||||
this.Print(gsfe.ToString());
|
||||
logger.InfoFormat(gsfe.ToString());
|
||||
|
||||
buffer = new byte[]
|
||||
{
|
||||
@ -581,7 +580,7 @@ public class DocsisTests : Feyllure
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void MacManagementMessageTest()
|
||||
{
|
||||
Random rng = new Random();
|
||||
@ -603,7 +602,7 @@ public class DocsisTests : Feyllure
|
||||
Assert.IsNull(ummm.MessageType);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void UpstreamChannelDescriptorTests()
|
||||
{
|
||||
byte[] buffer = new byte[]
|
||||
@ -672,7 +671,7 @@ public class DocsisTests : Feyllure
|
||||
Assert.AreEqual(3, ucd.UpstreamChannelID);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void BurstDescriptorTests()
|
||||
{
|
||||
byte[] buffer = new byte[]
|
||||
@ -751,7 +750,7 @@ public class DocsisTests : Feyllure
|
||||
Assert.Throws<NotImplementedException>(() => new UpstreamChannelDescriptor.BurstDescriptor(buffer));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void UcdChangeIndicatorBitmaskTest()
|
||||
{
|
||||
UpstreamChannelDescriptor.UcdChangeIndicatorBitmask ucdcib =
|
||||
@ -770,7 +769,7 @@ public class DocsisTests : Feyllure
|
||||
Assert.AreEqual(0xffff,ucdcib.GetRawValue());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void MultipartRegistrationResponse()
|
||||
{
|
||||
Random rng = new Random();
|
||||
@ -796,7 +795,7 @@ public class DocsisTests : Feyllure
|
||||
Assert.IsNotNull(mrr.TlvEncodedInformation);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void RangingResponseTest()
|
||||
{
|
||||
Random rng = new Random();
|
||||
@ -952,7 +951,7 @@ public class DocsisTests : Feyllure
|
||||
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void CommandPowerObjectTest()
|
||||
{
|
||||
byte[] payload = new byte[]
|
||||
@ -978,7 +977,7 @@ public class DocsisTests : Feyllure
|
||||
Assert.IsFalse(commandPower.Valid);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void PrivacyKeyManagementResponseTest()
|
||||
{
|
||||
NullDocsisEventHandler nullDocsisEventHandler = new NullDocsisEventHandler();
|
||||
@ -1130,7 +1129,7 @@ public class DocsisTests : Feyllure
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void KeyReplyTest()
|
||||
{
|
||||
byte[] payload = new byte[]
|
||||
@ -1140,7 +1139,7 @@ public class DocsisTests : Feyllure
|
||||
Assert.Throws<NotImplementedException>(() => new KeyReply(payload));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TekParameterTest()
|
||||
{
|
||||
byte[] payload = new byte[]
|
||||
@ -1155,10 +1154,10 @@ public class DocsisTests : Feyllure
|
||||
8, 0, 1, 2
|
||||
};
|
||||
KeyReply.TekParameter tekParameter = new KeyReply.TekParameter(payload);
|
||||
Print(tekParameter.ToString());
|
||||
logger.InfoFormat(tekParameter.ToString());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void DynamicServiceAdditionResponseTest()
|
||||
{
|
||||
NullDocsisEventHandler nullDocsisEventHandler = new NullDocsisEventHandler();
|
||||
@ -1178,7 +1177,7 @@ public class DocsisTests : Feyllure
|
||||
docsisEnvironment.PushMacManagementMessage(null, 2, 16, srcAddr, dstAddr, payload);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void NullDocsisEventHandlerTest()
|
||||
{
|
||||
NullDocsisEventHandler nullDocsisEventHandler = new NullDocsisEventHandler();
|
||||
@ -1189,12 +1188,12 @@ public class DocsisTests : Feyllure
|
||||
|
||||
nullDocsisEventHandler.OnParticipantDetected(srcAddr);
|
||||
HashSet<PhysicalAddress> physicalAddresses = nullDocsisEventHandler.GetParticipants();
|
||||
Assert.Contains(srcAddr, physicalAddresses);
|
||||
Assert.IsTrue(physicalAddresses.Contains(srcAddr));
|
||||
|
||||
rng.NextBytes(srcBuffer);
|
||||
srcAddr = new PhysicalAddress(srcBuffer);
|
||||
nullDocsisEventHandler.OnCmtsTimestamp(srcAddr, 1);
|
||||
Assert.Contains(srcAddr, physicalAddresses);
|
||||
Assert.IsTrue(physicalAddresses.Contains(srcAddr));
|
||||
Assert.AreEqual(1u, nullDocsisEventHandler.GetTiming());
|
||||
|
||||
byte[] ucdPayload = new byte[]
|
||||
@ -1224,7 +1223,7 @@ public class DocsisTests : Feyllure
|
||||
Assert.AreEqual(IPAddress.None, readOnlyDictionary[PhysicalAddress.None]);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void MacDomainDescriptorTest()
|
||||
{
|
||||
Random rng = new Random();
|
||||
@ -1263,15 +1262,15 @@ public class DocsisTests : Feyllure
|
||||
Assert.AreEqual(1, mmd.FragmentSequenceNumber);
|
||||
Assert.AreEqual(1, mmd.CurrentChannelDcid);
|
||||
Assert.IsNotNull(mmd.DownstreamServiceGroup);
|
||||
Assert.HasCount(1, mmd.DownstreamAmbiguityResolutionFrequencyList);
|
||||
Assert.AreEqual(1, mmd.DownstreamAmbiguityResolutionFrequencyList.Length);
|
||||
Assert.IsNotNull(mmd.ReceiveChannelProfileReportingControl);
|
||||
Assert.IsNotNull(mmd.IpInitalizationParameters);
|
||||
Assert.AreEqual(1, mmd.EarlyAuthentication.Value);
|
||||
Assert.HasCount(1, mmd.ActiveUpstreamChannelList);
|
||||
Assert.AreEqual(1, mmd.ActiveUpstreamChannelList.Count);
|
||||
Assert.AreEqual(1, mmd.UpstreamChannelIds[0]);
|
||||
Assert.AreEqual(1, mmd.UpstreamFrequencyRange.Value);
|
||||
Assert.IsTrue(mmd.SymbolClockLocking);
|
||||
Assert.HasCount(1, mmd.EventControlEncoding);
|
||||
Assert.AreEqual(1, mmd.EventControlEncoding.Count);
|
||||
Assert.AreEqual(1, mmd.UpstreamTransmitPowerReporting.Value);
|
||||
Assert.IsTrue(mmd.SequenceOutOfRange);
|
||||
Assert.IsTrue(mmd.CmOperatingOnBatteryBackup);
|
||||
@ -1,13 +1,11 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using skyscraper5.Mpeg2;
|
||||
|
||||
namespace skyscraper8.Tests.RootTests;
|
||||
namespace skyscraper8.Tests.NUnit.Tests.CoverageTests;
|
||||
|
||||
|
||||
[TestClass]
|
||||
public class Mpeg2Tests : Feyllure
|
||||
[TestFixture]
|
||||
public class Mpeg2CoverageTests : SkyscrapersTestingFramework
|
||||
{
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void PsiSectionTest()
|
||||
{
|
||||
PsiSection section = new PsiSection();
|
||||
@ -1,15 +1,12 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using skyscraper5.Skyscraper;
|
||||
using skyscraper8.Skyscraper.Scraper.Storage.Tar;
|
||||
|
||||
namespace skyscraper8.Tests;
|
||||
namespace skyscraper8.Tests.NUnit.Tests.IntegrationTests;
|
||||
|
||||
[TestClass]
|
||||
public class IntegrationTests
|
||||
[TestFixture]
|
||||
public class SkyscraperIntegrationTests : SkyscrapersTestingFramework
|
||||
{
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void CreateTarArchive()
|
||||
{
|
||||
string filename = String.Format("{0}.tar", DateTime.Now.ToUnixTime());
|
||||
@ -1,16 +1,15 @@
|
||||
using System.IO;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using skyscraper5.Mpeg2;
|
||||
using skyscraper5.Skyscraper.Scraper;
|
||||
using skyscraper5.Skyscraper.Scraper.Storage.InMemory;
|
||||
using skyscraper8.Skyscraper.Scraper.Storage;
|
||||
using skyscraper8.Tests.NUnit;
|
||||
|
||||
namespace skyscraper8.Tests;
|
||||
namespace skyscraper8.Tests.NUnit.Tests;
|
||||
|
||||
[TestClass]
|
||||
public class CapturedTests : Feyllure
|
||||
[TestFixture]
|
||||
public class RecordedSamplesTests : SkyscrapersTestingFramework
|
||||
{
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void RussianT2Mi()
|
||||
{
|
||||
FileStream streamSample = GetStreamSample("express_3928L_t2mi.ts");
|
||||
@ -19,7 +18,7 @@ public class CapturedTests : Feyllure
|
||||
//42931 uncovered
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void Simmin()
|
||||
{
|
||||
FileStream streamSample = GetStreamSample("thor_11049v_simmin-radiomidun.ts");
|
||||
@ -28,7 +27,7 @@ public class CapturedTests : Feyllure
|
||||
//36611 uncovered
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void GseDab()
|
||||
{
|
||||
FileStream streamSample = GetStreamSample("thor_10717v_gse-dab.ts");
|
||||
@ -37,16 +36,16 @@ public class CapturedTests : Feyllure
|
||||
//36446 uncovered
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void SouthAmericanNip()
|
||||
{
|
||||
FileStream streamSample = GetStreamSample("argentinian-dvb-nip-000000.ts");
|
||||
FileStream streamSample = GetStreamSample("brazilian-dvb-nip-000000.ts");
|
||||
ProcessSample(streamSample);
|
||||
streamSample.Close();
|
||||
//35222
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void GseNip()
|
||||
{
|
||||
FileStream streamSample = GetStreamSample("astra1_12441v_gse-nip.ts");
|
||||
@ -55,7 +54,7 @@ public class CapturedTests : Feyllure
|
||||
//34545
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void GseNip2()
|
||||
{
|
||||
FileStream streamSample = GetStreamSample("astra1_11141h_gse_nip.ts");
|
||||
@ -64,7 +63,7 @@ public class CapturedTests : Feyllure
|
||||
//34462
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TsNipIncludingLegacyChannel()
|
||||
{
|
||||
FileStream streamSample = GetStreamSample("hotbird_12380v_nip.ts");
|
||||
@ -73,7 +72,7 @@ public class CapturedTests : Feyllure
|
||||
//33518
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TsNip()
|
||||
{
|
||||
FileStream streamSample = GetStreamSample("hotbird_12226v_nip.ts");
|
||||
@ -82,7 +81,7 @@ public class CapturedTests : Feyllure
|
||||
//33518
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void GseRcs2()
|
||||
{
|
||||
FileStream streamSample = GetStreamSample("telstar12v-bfbs-000000.ts");
|
||||
@ -91,7 +90,7 @@ public class CapturedTests : Feyllure
|
||||
//32559
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void BadrDvbSis()
|
||||
{
|
||||
FileStream streamSample = GetStreamSample("badr_12563v_dvb-sis.ts");
|
||||
@ -99,7 +98,7 @@ public class CapturedTests : Feyllure
|
||||
streamSample.Close();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void Eutelsat5DvbSis()
|
||||
{
|
||||
FileStream streamSample = GetStreamSample("eutelsat5_12522v_dvb-sis.ts");
|
||||
@ -122,4 +121,5 @@ public class CapturedTests : Feyllure
|
||||
context.InitalizeFilterChain();
|
||||
context.IngestFromStream(sample);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,24 +1,22 @@
|
||||
using System;
|
||||
using System.Net.NetworkInformation;
|
||||
using skyscraper5.Docsis;
|
||||
using skyscraper5.Docsis.AnnexC;
|
||||
using skyscraper5.Docsis.MacManagement;
|
||||
using System.Net.NetworkInformation;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace skyscraper8.Tests.ResourceTests
|
||||
namespace skyscraper8.Tests.NUnit.Tests.ResourceTests;
|
||||
|
||||
[TestFixture]
|
||||
public class DocsisResourceTests : SkyscrapersTestingFramework
|
||||
{
|
||||
[TestClass]
|
||||
public class DocsisTests : Feyllure
|
||||
{
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void ModemCapabilitiesEncoding()
|
||||
{
|
||||
byte[] buffer = Resources1.ModemCapabilitiesEncodingTest;
|
||||
byte[] buffer = Properties.Resources.ModemCapabilitiesEncodingTest;
|
||||
ModemCapabilitiesEncoding modemCapabilitiesEncoding = new ModemCapabilitiesEncoding(buffer);
|
||||
Assert.IsTrue(modemCapabilitiesEncoding.Valid);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void MultipartRegistrationResponse()
|
||||
{
|
||||
Random rng = new Random();
|
||||
@ -31,18 +29,18 @@ namespace skyscraper8.Tests.ResourceTests
|
||||
rng.NextBytes(targetBuffer);
|
||||
PhysicalAddress target = new PhysicalAddress(targetBuffer);
|
||||
|
||||
byte[] buffer = Resources1.MultipartRegistrationResponseTest;
|
||||
byte[] buffer = Properties.Resources.T45_V4_MultipartRegistrationResponseTest;
|
||||
T45_V4_MultipartRegistrationResponse test = new T45_V4_MultipartRegistrationResponse(source, target, buffer);
|
||||
Assert.IsTrue(test.Valid);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void MacManagement_4_45()
|
||||
{
|
||||
NullDocsisEventHandler docsisEventHandler = new NullDocsisEventHandler();
|
||||
DocsisEnvironment environment = new DocsisEnvironment(docsisEventHandler);
|
||||
|
||||
byte[] testPayload = Resources1.PushMacManagementMessage_Version4_Type45;
|
||||
byte[] testPayload = Properties.Resources.PushMacManagementMessage_Version4_Type45;
|
||||
|
||||
Random rng = new Random();
|
||||
byte[] sourceBuffer = new byte[6];
|
||||
@ -56,10 +54,10 @@ namespace skyscraper8.Tests.ResourceTests
|
||||
environment.PushMacManagementMessage(testPayload, 4, 45, source, target, testPayload);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void InvalidUpstreamChannelDescriptorTest()
|
||||
{
|
||||
byte[] testPayload = Resources1.UpstreamChannelDescriptorTest;
|
||||
byte[] testPayload = Properties.Resources.UpstreamChannelDescriptorTest;
|
||||
|
||||
Random rng = new Random();
|
||||
byte[] sourceBuffer = new byte[6];
|
||||
@ -74,16 +72,16 @@ namespace skyscraper8.Tests.ResourceTests
|
||||
Assert.IsFalse(ucd.Valid);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TransmitChannelConfigurationObjectTest()
|
||||
{
|
||||
byte[] testPayload = Resources1.TransmitChannelConfigurationObject;
|
||||
byte[] testPayload = Properties.Resources.TransmitChannelConfigurationObject;
|
||||
|
||||
CommonTlvEncodingObject.TransmitChannelConfigurationObject child = new CommonTlvEncodingObject.TransmitChannelConfigurationObject(testPayload);
|
||||
Assert.IsTrue(child.Valid);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void MultipartRegistrationResponse2()
|
||||
{
|
||||
Random rng = new Random();
|
||||
@ -96,15 +94,15 @@ namespace skyscraper8.Tests.ResourceTests
|
||||
rng.NextBytes(targetBuffer);
|
||||
PhysicalAddress target = new PhysicalAddress(targetBuffer);
|
||||
|
||||
byte[] buffer = Resources1.MultipartRegistrationResponseTest2;
|
||||
byte[] buffer = Properties.Resources.T45_V4_MultipartRegistrationResponseTest2;
|
||||
T45_V4_MultipartRegistrationResponse test = new T45_V4_MultipartRegistrationResponse(source, target, buffer);
|
||||
Assert.IsTrue(test.Valid);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void OffsetBreakerTest()
|
||||
{
|
||||
byte[] blob = Resources1.ranging_response_test;
|
||||
byte[] blob = Properties.Resources.ranging_response_test;
|
||||
Random rng = new Random();
|
||||
|
||||
byte[] sourceMacBuffer = new byte[6];
|
||||
@ -119,4 +117,3 @@ namespace skyscraper8.Tests.ResourceTests
|
||||
Assert.IsTrue(rangingResponse.Valid);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,17 +1,16 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using skyscraper8.GS;
|
||||
using skyscraper8.GS.GSE_RollingSyncByte;
|
||||
using skyscraper8.GSE;
|
||||
|
||||
namespace skyscraper8.Tests.ResourceTests;
|
||||
namespace skyscraper8.Tests.NUnit.Tests.ResourceTests;
|
||||
|
||||
[TestClass]
|
||||
public class Ses12GseTest
|
||||
[TestFixture]
|
||||
public class GsResourceTests
|
||||
{
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestShortPdu()
|
||||
{
|
||||
byte[] datasource = Resources1.Frame00000357_TSGS1_MIS000_SYNC184;
|
||||
byte[] datasource = Properties.Resources.Frame00000357_TSGS1_MIS000_SYNC184;
|
||||
GsContextDto dto = new GsContextDto();
|
||||
GseWithRollingSyncByteReader reader = new GseWithRollingSyncByteReader(dto);
|
||||
reader.PushFrame(new BBHeader(new byte[10], 0), datasource);
|
||||
@ -0,0 +1,17 @@
|
||||
using skyscraper8.Ietf.Rfc4566_SDP;
|
||||
|
||||
namespace skyscraper8.Tests.NUnit.Tests.ResourceTests;
|
||||
|
||||
[TestFixture]
|
||||
public class IetfSdpResourceTests : SkyscrapersTestingFramework
|
||||
{
|
||||
[Test]
|
||||
public void TestSdpParser()
|
||||
{
|
||||
MemoryStream ms = new MemoryStream(Properties.Resources.sdpTest, false);
|
||||
Assert.IsTrue(SDP.IsSDP(ms));
|
||||
|
||||
SDP loaded = SDP.Load(ms);
|
||||
Assert.IsNotNull(loaded);
|
||||
}
|
||||
}
|
||||
@ -1,31 +1,28 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using skyscraper5.Mpeg2;
|
||||
|
||||
namespace skyscraper8.Tests.ResourceTests;
|
||||
namespace skyscraper8.Tests.NUnit.Tests.ResourceTests;
|
||||
|
||||
[TestClass]
|
||||
public class GsType1SanityTest : Feyllure
|
||||
[TestFixture]
|
||||
public class Mpeg2ResourceTests
|
||||
{
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void CheckBfbsCrc()
|
||||
{
|
||||
byte[] blob = Resources1.Frame00001343_TSGS1_MIS000_SYNC001;
|
||||
byte[] blob = Properties.Resources.Frame00001343_TSGS1_MIS000_SYNC001;
|
||||
MemoryStream ms = new MemoryStream(blob, false);
|
||||
bool result = DvbCrc32.ValidateCrc(ms, 0, (int)ms.Length);
|
||||
Assert.IsTrue(result);
|
||||
|
||||
blob = Resources1.Frame00000008_TSGS1_MIS000_SYNC001;
|
||||
blob = Properties.Resources.Frame00000008_TSGS1_MIS000_SYNC001;
|
||||
ms = new MemoryStream(blob, false);
|
||||
result = DvbCrc32.ValidateCrc(ms, 0, (int)ms.Length);
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void CheckBfbsCrcSpan()
|
||||
{
|
||||
byte[] blob = Resources1.Frame00000012_TSGS1_MIS000_SYNC001;
|
||||
byte[] blob = Properties.Resources.Frame00000012_TSGS1_MIS000_SYNC001;
|
||||
ReadOnlySpan<byte> span = new ReadOnlySpan<byte>(blob);
|
||||
bool result = DvbCrc32.ValidateCrc(span);
|
||||
Assert.IsTrue(result);
|
||||
@ -0,0 +1,39 @@
|
||||
using skyscraper5.Mpeg2;
|
||||
using skyscraper5.Skyscraper.Scraper;
|
||||
using skyscraper5.Skyscraper.Scraper.Storage.InMemory;
|
||||
using skyscraper8.Skyscraper.Scraper.Storage;
|
||||
|
||||
namespace skyscraper8.Tests.NUnit.Tests.ResourceTests;
|
||||
|
||||
[TestFixture]
|
||||
public class SkyscraperResourceTests : SkyscrapersTestingFramework
|
||||
{
|
||||
[Test]
|
||||
public void RunTestPatterns()
|
||||
{
|
||||
byte[][] buffers = new byte[][]
|
||||
{
|
||||
Properties.Resources.test_1packet_01,
|
||||
Properties.Resources.test_2packets_02_03,
|
||||
Properties.Resources.test_3packets_04_05_06
|
||||
};
|
||||
|
||||
InMemoryScraperStorageFactory imssf = new InMemoryScraperStorageFactory();
|
||||
|
||||
foreach (byte[] buffer in buffers)
|
||||
{
|
||||
TsContext mpeg2 = new TsContext();
|
||||
DataStorage ds = new InMemoryScraperStorageFactory().CreateDataStorage();
|
||||
ObjectStorage os = new NullObjectStorage();
|
||||
|
||||
SkyscraperContext skyscraper = new SkyscraperContext(mpeg2, ds, os);
|
||||
MemoryStream ms = new MemoryStream(buffer, false);
|
||||
|
||||
skyscraper.InitalizeFilterChain();
|
||||
skyscraper.IngestFromStream(ms);
|
||||
|
||||
ms.Close();
|
||||
ms.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
44
skyscraper8.Tests.NUnit/skyscraper8.Tests.NUnit.csproj
Normal file
44
skyscraper8.Tests.NUnit/skyscraper8.Tests.NUnit.csproj
Normal file
@ -0,0 +1,44 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
|
||||
<PackageReference Include="NUnit" Version="3.13.3" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
|
||||
<PackageReference Include="NUnit.Analyzers" Version="3.6.1" />
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="Resources1.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources1.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\skyscraper8\skyscraper8.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@ -1,9 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Resources1.resx">
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@ -1,5 +0,0 @@
|
||||
{
|
||||
"allure": {
|
||||
"directory": "allure-results"
|
||||
}
|
||||
}
|
||||
@ -1,193 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using Allure.Net.Commons;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using TestResult = Allure.Net.Commons.TestResult;
|
||||
|
||||
namespace skyscraper8.Tests;
|
||||
|
||||
[TestClass]
|
||||
public class Feyllure
|
||||
{
|
||||
public TestContext TestContext { get; set; }
|
||||
|
||||
protected static readonly AllureLifecycle Allure = AllureLifecycle.Instance;
|
||||
|
||||
private bool assemblyWasInited;
|
||||
private void AssemblyInit(TestContext context)
|
||||
{
|
||||
// Ensure allure-results exists
|
||||
var resultsDir = Allure.ResultsDirectory;
|
||||
Directory.CreateDirectory(resultsDir);
|
||||
|
||||
var envFile = Path.Combine(resultsDir, "environment.properties");
|
||||
|
||||
using (var writer = new StreamWriter(envFile))
|
||||
{
|
||||
writer.WriteLine($"SkyscraperRelease={VersionInfo.GetPublicReleaseNumber()}");
|
||||
writer.WriteLine($"SkyscraperCodeVersion={VersionInfo.GetCurrentAssemblyDisplayVersion()}");
|
||||
writer.WriteLine($"OS={RuntimeInformation.OSDescription}");
|
||||
writer.WriteLine($".NET={Environment.Version}");
|
||||
writer.WriteLine($"Machine={Environment.MachineName}");
|
||||
writer.WriteLine($"User={Environment.UserName}");
|
||||
writer.WriteLine($"Framework={System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription}");
|
||||
writer.WriteLine($"BuildDate={DateTime.UtcNow:yyyy-MM-dd HH:mm:ss}");
|
||||
}
|
||||
|
||||
var executorFile = Path.Combine(resultsDir, "executor.json");
|
||||
var executorInfo = new
|
||||
{
|
||||
name = Environment.MachineName,
|
||||
buildName = "My build name",
|
||||
buildUrl = "http://127.0.0.2",
|
||||
};
|
||||
var executorJson = Newtonsoft.Json.JsonConvert.SerializeObject(executorInfo);
|
||||
File.WriteAllText(executorFile, executorJson);
|
||||
}
|
||||
|
||||
[TestInitialize]
|
||||
public void Setup()
|
||||
{
|
||||
if (!assemblyWasInited){
|
||||
AssemblyInit(TestContext);
|
||||
assemblyWasInited = true;
|
||||
}
|
||||
var testName = TestContext.TestName;
|
||||
var fqClass = TestContext.FullyQualifiedTestClassName;
|
||||
|
||||
// Extract namespace and class name
|
||||
var lastDot = fqClass.LastIndexOf('.');
|
||||
var ns = lastDot > 0 ? fqClass.Substring(0, lastDot) : "";
|
||||
var cls = lastDot > 0 ? fqClass.Substring(lastDot + 1) : fqClass;
|
||||
|
||||
TestResult testResult = new TestResult();
|
||||
testResult.uuid = Guid.NewGuid().ToString();
|
||||
testResult.name = testName;
|
||||
testResult.fullName = String.Format("{0}.{1}", TestContext.FullyQualifiedTestClassName, testName);
|
||||
testResult.labels = new List<Label>()
|
||||
{
|
||||
//Packages Tab
|
||||
new Label { name = "package", value = ns},
|
||||
new Label { name = "testClass", value = cls},
|
||||
new Label { name = "testMethod", value = testName},
|
||||
|
||||
//Suites tab
|
||||
new Label { name = "parentSuite", value = ns},
|
||||
new Label { name = "suite", value = cls},
|
||||
};
|
||||
|
||||
Allure.StartTestCase(testResult);
|
||||
|
||||
descriptionWriter = null;
|
||||
}
|
||||
|
||||
[TestCleanup]
|
||||
public void TearDown()
|
||||
{
|
||||
switch (TestContext.CurrentTestOutcome)
|
||||
{
|
||||
case UnitTestOutcome.Passed:
|
||||
Allure.UpdateTestCase(tc => tc.status = Status.passed);
|
||||
break;
|
||||
case UnitTestOutcome.Failed:
|
||||
Allure.UpdateTestCase(tc => tc.status = Status.failed);
|
||||
break;
|
||||
case UnitTestOutcome.Inconclusive:
|
||||
Allure.UpdateTestCase(tc => tc.status = Status.skipped);
|
||||
Print("\n\n" + TestContext.TestException.ToString());
|
||||
break;
|
||||
default:
|
||||
StepResult stepResult = new StepResult();
|
||||
stepResult.name = String.Format("Current Test Outcome: {0}", TestContext.CurrentTestOutcome);;
|
||||
Allure.UpdateTestCase(tc =>
|
||||
{
|
||||
tc.status = Status.skipped;
|
||||
tc.steps.Add(stepResult);
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
if (descriptionWriter != null)
|
||||
{
|
||||
Allure.UpdateTestCase(tc => { tc.description = descriptionWriter.ToString(); });
|
||||
}
|
||||
|
||||
Allure.StopTestCase();
|
||||
Allure.WriteTestCase();
|
||||
}
|
||||
|
||||
private StringWriter descriptionWriter;
|
||||
public void Print(string message, params object[] args)
|
||||
{
|
||||
if (descriptionWriter == null)
|
||||
descriptionWriter = new StringWriter();
|
||||
string formattedMessage = String.Format(message, args);
|
||||
Console.WriteLine(formattedMessage);
|
||||
descriptionWriter.WriteLine(formattedMessage);
|
||||
}
|
||||
|
||||
private DirectoryInfo testsuitePath;
|
||||
protected DirectoryInfo GetTestsuitePath()
|
||||
{
|
||||
Print("Checking whether skyscraper-testsuite exists...");
|
||||
if (Directory.Exists("skyscraper-testsuite"))
|
||||
{
|
||||
testsuitePath = new DirectoryInfo("skyscraper8-testsuite");
|
||||
return testsuitePath;
|
||||
}
|
||||
|
||||
Print("Checking TESTSUITE_PATH...");
|
||||
string directory = Environment.GetEnvironmentVariable("TESTSUITE_PATH");
|
||||
if (!string.IsNullOrEmpty(directory))
|
||||
{
|
||||
testsuitePath = new DirectoryInfo(directory);
|
||||
return testsuitePath;
|
||||
}
|
||||
|
||||
FileInfo pointerFile = new FileInfo("skyscraper8-testsuite-path.txt");
|
||||
Print("Checking {0}...",pointerFile.FullName);
|
||||
if (File.Exists(pointerFile.FullName))
|
||||
{
|
||||
string readAllText = File.ReadAllText(pointerFile.FullName);
|
||||
readAllText = readAllText.Trim();
|
||||
testsuitePath = new DirectoryInfo(readAllText);
|
||||
return testsuitePath;
|
||||
}
|
||||
|
||||
Assert.Inconclusive("Could not find the test suite path.");
|
||||
return null;
|
||||
}
|
||||
|
||||
protected FileStream GetStreamSample(string streamName)
|
||||
{
|
||||
DirectoryInfo testsuitePath = GetTestsuitePath();
|
||||
string combine = Path.Combine(testsuitePath.FullName, streamName);
|
||||
FileInfo result = new FileInfo(combine);
|
||||
if (!result.Exists)
|
||||
{
|
||||
Assert.Inconclusive(String.Format("Could not find {0}",result.FullName));
|
||||
return null;
|
||||
}
|
||||
|
||||
return result.OpenRead();
|
||||
}
|
||||
|
||||
protected void AssertTargetInvocation<T>(Action action)
|
||||
where T: Exception
|
||||
{
|
||||
Assert.Throws<T>(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
action();
|
||||
}
|
||||
catch (TargetInvocationException tie)
|
||||
{
|
||||
throw tie.InnerException;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
63
skyscraper8.Tests/Properties/Resources.Designer.cs
generated
63
skyscraper8.Tests/Properties/Resources.Designer.cs
generated
@ -1,63 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Dieser Code wurde von einem Tool generiert.
|
||||
// Laufzeitversion:4.0.30319.42000
|
||||
//
|
||||
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code erneut generiert wird.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace skyscraper8.Tests.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
/// </summary>
|
||||
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("skyscraper8.Tests.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,101 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 1.3
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">1.3</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1">this is my long string</data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
[base64 mime encoded serialized .NET Framework object]
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
[base64 mime encoded string representing a byte array form of the .NET Framework object]
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>1.3</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@ -1,25 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using skyscraper8.Ietf.Rfc4566_SDP;
|
||||
|
||||
namespace skyscraper8.Tests.ResourceTests
|
||||
{
|
||||
[TestClass]
|
||||
public class SdpTest : Feyllure
|
||||
{
|
||||
[TestMethod]
|
||||
public void TestSdpParser()
|
||||
{
|
||||
MemoryStream ms = new MemoryStream(Resources1.sdpTest, false);
|
||||
Assert.IsTrue(SDP.IsSDP(ms));
|
||||
|
||||
SDP loaded = SDP.Load(ms);
|
||||
Assert.IsNotNull(loaded);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,42 +0,0 @@
|
||||
using System.IO;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using skyscraper5.Mpeg2;
|
||||
using skyscraper5.Skyscraper.Scraper;
|
||||
using skyscraper5.Skyscraper.Scraper.Storage.InMemory;
|
||||
using skyscraper8.Skyscraper.Scraper.Storage;
|
||||
|
||||
namespace skyscraper8.Tests.ResourceTests
|
||||
{
|
||||
[TestClass]
|
||||
public class SkyscraperTests : Feyllure
|
||||
{
|
||||
[TestMethod]
|
||||
public void RunTestPatterns()
|
||||
{
|
||||
byte[][] buffers = new byte[][]
|
||||
{
|
||||
Resources1.test_1packet_01,
|
||||
Resources1.test_2packets_02_03,
|
||||
Resources1.test_3packets_04_05_06
|
||||
};
|
||||
|
||||
InMemoryScraperStorageFactory imssf = new InMemoryScraperStorageFactory();
|
||||
|
||||
foreach (byte[] buffer in buffers)
|
||||
{
|
||||
TsContext mpeg2 = new TsContext();
|
||||
DataStorage ds = new InMemoryScraperStorageFactory().CreateDataStorage();
|
||||
ObjectStorage os = new NullObjectStorage();
|
||||
|
||||
SkyscraperContext skyscraper = new SkyscraperContext(mpeg2, ds, os);
|
||||
MemoryStream ms = new MemoryStream(buffer, false);
|
||||
|
||||
skyscraper.InitalizeFilterChain();
|
||||
skyscraper.IngestFromStream(ms);
|
||||
|
||||
ms.Close();
|
||||
ms.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,47 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Target .NET 8 -->
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
|
||||
<!-- Mark this as a test project -->
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- MSTest framework -->
|
||||
<PackageReference Include="Allure.Net.Commons" Version="2.14.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="4.0.2" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="4.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\skyscraper8\skyscraper8.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="Resources1.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources1.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="Resources1.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources1.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@ -65,7 +65,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "skyscraper8.UI.MonoGame", "
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "skyscraper8.UI.MonoGame.Bridge", "GUIs\skyscraper8.UI.ImGui.MonoGame.Bridge\skyscraper8.UI.MonoGame.Bridge.csproj", "{1A29F6E6-4B6A-DCCD-1DF1-AA8D020E17D2}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "skyscraper8.Tests", "skyscraper8.Tests\skyscraper8.Tests.csproj", "{84EE9FCD-2C7F-DF84-C1BA-99D018CE9412}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "skyscraper8.Tests.NUnit", "skyscraper8.Tests.NUnit\skyscraper8.Tests.NUnit.csproj", "{5FB2AA76-580E-4343-B155-5D596DDC27F2}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@ -143,10 +143,10 @@ Global
|
||||
{1A29F6E6-4B6A-DCCD-1DF1-AA8D020E17D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1A29F6E6-4B6A-DCCD-1DF1-AA8D020E17D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1A29F6E6-4B6A-DCCD-1DF1-AA8D020E17D2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{84EE9FCD-2C7F-DF84-C1BA-99D018CE9412}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{84EE9FCD-2C7F-DF84-C1BA-99D018CE9412}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{84EE9FCD-2C7F-DF84-C1BA-99D018CE9412}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{84EE9FCD-2C7F-DF84-C1BA-99D018CE9412}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{5FB2AA76-580E-4343-B155-5D596DDC27F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5FB2AA76-580E-4343-B155-5D596DDC27F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5FB2AA76-580E-4343-B155-5D596DDC27F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5FB2AA76-580E-4343-B155-5D596DDC27F2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAssert_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003F62bb4746d7d14dc1cd4274a28788572a7a4641bd3a7d5736479c9697bcb4794_003FAssert_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAssert_002EInconclusive_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003F8e305e26401afcd395b5be2da0e23d61432655dc5f2c2e5e6d5bd873bb0cb90_003FAssert_002EInconclusive_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAssert_002EThrowsException_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Fe6930caf46f7fcaa445fdd26a3884170a45a4766298259e7a29bae560adef_003FAssert_002EThrowsException_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ABeforeAndAfterTestCommand_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2026_002E1_003Fresharper_002Dhost_003FSourcesCache_003Ff536671e825030c7f17fbf3f75511651c281f2429edc8fd6ea660418f825949_003FBeforeAndAfterTestCommand_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACultureInfo_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F57d616db882b441b8c50720b4477e03db2e200_003F8e_003Fe58e5b4a_003FCultureInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADictionary_00602_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F57d616db882b441b8c50720b4477e03db2e200_003F83_003Fc73c45bc_003FDictionary_00602_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADictionary_00602_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2026_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Ffd0d7846a16a4147ad767b7c3ae2cf57b2e200_003F4a_003Ff8de026f_003FDictionary_00602_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
|
||||
@ -14,5 +14,6 @@ namespace skyscraper8.Atsc.A331
|
||||
void OnAtsc3Detected();
|
||||
void OnAtsc3ServiceList(sltType slt);
|
||||
void OnAtsc3FileDelivery(IPEndPoint destination, ulong tsi, ulong toi, FluteListener targetListener, GuessedFluteDataType guessedFluteDataType, string outFileName);
|
||||
void OnAtsc3MbmsEnvelope(MbmsEnvelope mbmsEnvelope);
|
||||
}
|
||||
}
|
||||
|
||||
@ -169,6 +169,10 @@ namespace skyscraper8.Atsc.A331
|
||||
case GuessedFluteDataType.Mime:
|
||||
MimeMessage mimeMessage = MimeMessage.Load(targetListener.ToStream());
|
||||
MbmsEnvelope mbmsEnvelope = new MbmsEnvelope(mimeMessage);
|
||||
if (mbmsEnvelope.HasContent)
|
||||
{
|
||||
eventHandler.OnAtsc3MbmsEnvelope(mbmsEnvelope);
|
||||
}
|
||||
filenames.LearnFilename(mbmsEnvelope);
|
||||
return true;
|
||||
case GuessedFluteDataType.Stuffing:
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using MimeKit;
|
||||
using Schemas;
|
||||
using skyscraper5.Skyscraper;
|
||||
using skyscraper8.Atsc.A331.Schema;
|
||||
using skyscraper8.MpegDash.Schema;
|
||||
|
||||
@ -48,4 +49,27 @@ public class MbmsEnvelope
|
||||
public MPDtype MediaPresentationDescription { get; private set; }
|
||||
|
||||
public metadataEnvelopeType MetadataEnvelope {get; private set;}
|
||||
|
||||
public bool HasContent
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Atsc3RouteUsd != null)
|
||||
return true;
|
||||
|
||||
if (Atsc3Stsid != null)
|
||||
return true;
|
||||
|
||||
if (Atsc3Held != null)
|
||||
return true;
|
||||
|
||||
if (MediaPresentationDescription != null)
|
||||
return true;
|
||||
|
||||
if (MetadataEnvelope != null)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,5 +53,17 @@ namespace skyscraper8.Skyscraper.Net.VirtualNetworks
|
||||
return child;
|
||||
}
|
||||
}
|
||||
|
||||
public ushort? GetPid()
|
||||
{
|
||||
VirtualNetworkIdentifier virtualNetworkIdentifier = wrapped;
|
||||
PidNetworkIdentifier pid = wrapped as PidNetworkIdentifier;
|
||||
if (pid != null)
|
||||
{
|
||||
return pid.PID;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,6 +21,8 @@ using skyscraper5.src.InteractionChannel.Model2;
|
||||
using skyscraper5.src.Skyscraper.FrequencyListGenerator;
|
||||
using skyscraper5.T2MI.Packets;
|
||||
using skyscraper5.Teletext.Wss;
|
||||
using skyscraper8.Atsc.A331;
|
||||
using skyscraper8.Atsc.A331.Schema;
|
||||
using skyscraper8.DvbNip;
|
||||
using skyscraper8.DvbNip.UiIntegration;
|
||||
using skyscraper8.DvbSis;
|
||||
@ -251,5 +253,7 @@ namespace skyscraper5.Skyscraper.Scraper
|
||||
void WneStoryError(uint sessionId);
|
||||
void WneStoryProgress(uint sessionId, string filename, long fileCaught, uint fileSize);
|
||||
void WneStoryComplete(uint sessionId, string filename);
|
||||
void Atsc3Service(sltType slt);
|
||||
void Atsc3MbmsEnvelope(MbmsEnvelope mbmsEnvelope);
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,7 +106,8 @@ namespace skyscraper5.Skyscraper.Scraper
|
||||
UpdateNotificationEventHandler, DataCarouselEventHandler, RdsEventHandler, IScte35EventHandler,
|
||||
IAutodetectionEventHandler, IRstEventHandler, IRntEventHandler, IMultiprotocolEncapsulationEventHandler, ObjectCarouselEventHandler, T2MIEventHandler,
|
||||
IDisposable, IFrameGrabberEventHandler, IntEventHandler, IRctEventHandler, ISkyscraperContext, IDocsisEventHandler, AbertisDecoderEventHandler, Id3Handler,
|
||||
InteractionChannelHandler, SgtEventHandler, IDvbNipEventHandler, UleEventHandler, OtvSsuHandler, NdsSsuHandler, ISubTsHandler, ILldpFrameHandler, SisHandler, IWneHandler, IAtscPlpEventHandler, IAtsc3EventHandler
|
||||
InteractionChannelHandler, SgtEventHandler, IDvbNipEventHandler, UleEventHandler, OtvSsuHandler, NdsSsuHandler, ISubTsHandler, ILldpFrameHandler, SisHandler, IWneHandler,
|
||||
IAtscPlpEventHandler, IAtsc3EventHandler
|
||||
{
|
||||
public const bool ALLOW_STREAM_TYPE_AUTODETECTION = true;
|
||||
public const bool ALLOW_FFMPEG_FRAMEGRABBER = true;
|
||||
@ -3034,6 +3035,15 @@ namespace skyscraper5.Skyscraper.Scraper
|
||||
{
|
||||
TeiOnOffFilter.SetExempt(pidId.PID);
|
||||
}
|
||||
AtmAdaptationLayer5NetworkIdentifier aal5Id = network as AtmAdaptationLayer5NetworkIdentifier;
|
||||
if (aal5Id != null)
|
||||
{
|
||||
ushort? pid = aal5Id.GetPid();
|
||||
if (pid != null)
|
||||
{
|
||||
TeiOnOffFilter.SetExempt(pid.Value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (etherType <= 1500)
|
||||
@ -3095,7 +3105,7 @@ namespace skyscraper5.Skyscraper.Scraper
|
||||
ushort newEtherType = BitConverter.ToUInt16(contents, 26);
|
||||
byte[] newPacket = new byte[contents.Length - 28];
|
||||
Array.Copy(contents, 28, newPacket, 0, newPacket.Length);
|
||||
OnEthernetFrame(AtmAdaptationLayer5NetworkIdentifier.GetWrap(network), destination, source, newEtherType, newPacket);
|
||||
OnEthernetFrame(network, destination, source, newEtherType, newPacket);
|
||||
}
|
||||
return;
|
||||
case 0x94ad:
|
||||
@ -3580,12 +3590,14 @@ namespace skyscraper5.Skyscraper.Scraper
|
||||
public void OnAtsc3Detected()
|
||||
{
|
||||
LogEvent(SkyscraperContextEvent.Atsc3Detected);
|
||||
UiJunction?.EnableUiFeature(SkyscraperUiFeature.Atsc3Analysis);
|
||||
}
|
||||
|
||||
public void OnAtsc3ServiceList(sltType slt)
|
||||
{
|
||||
foreach (serviceType service in slt.Service)
|
||||
{
|
||||
UiJunction?.Atsc3Service(slt);
|
||||
if (DataStorage.UpsertAtsc3Service(service))
|
||||
{
|
||||
LogEvent(SkyscraperContextEvent.Atsc3ServiceFound, service.shortServiceName);
|
||||
@ -3604,5 +3616,25 @@ namespace skyscraper5.Skyscraper.Scraper
|
||||
stream.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public void OnAtsc3MbmsEnvelope(MbmsEnvelope mbmsEnvelope)
|
||||
{
|
||||
UiJunction?.Atsc3MbmsEnvelope(mbmsEnvelope);
|
||||
if (mbmsEnvelope.Atsc3Held != null)
|
||||
{
|
||||
foreach (HTMLEntryPackageType htmlEntryPackageType in mbmsEnvelope.Atsc3Held.HTMLEntryPackage)
|
||||
{
|
||||
if (DataStorage.UpsertAtsc3Held(htmlEntryPackageType))
|
||||
{
|
||||
LogEvent(SkyscraperContextEvent.Atsc3Held, htmlEntryPackageType.appContextId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//ROUTE USD has no clear identifier.
|
||||
//STSID has no clear identifier.
|
||||
//MPD has no clear identifier.
|
||||
//Metadata Envelope has no clear identifier
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,6 +107,7 @@
|
||||
DvbSisDaughterSiteAdapterConfiguration,
|
||||
Atsc3Detected,
|
||||
Atsc3ServiceFound,
|
||||
Atsc3Segment
|
||||
Atsc3Segment,
|
||||
Atsc3Held
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,6 +15,7 @@ namespace skyscraper8.Skyscraper.Scraper
|
||||
GseAnalysis,
|
||||
DvbNipAnalyis,
|
||||
RcsAnalysis,
|
||||
LlcSnapTrafficAnalysis
|
||||
LlcSnapTrafficAnalysis,
|
||||
Atsc3Analysis
|
||||
}
|
||||
}
|
||||
|
||||
@ -204,5 +204,12 @@ namespace skyscraper8.Skyscraper.Scraper.Storage
|
||||
/// <param name="service">An ATSC3 Service</param>
|
||||
/// <returns>true if the service was added or was changed, false if no changes in the DB were made.</returns>
|
||||
bool UpsertAtsc3Service(serviceType service);
|
||||
|
||||
/// <summary>
|
||||
/// Inserts or Updates the HELD table row of an ATSC 3 service.
|
||||
/// </summary>
|
||||
/// <param name="htmlEntryPackageType">A row of a HELD table</param>
|
||||
/// <returns>true if the service was added or was changed</returns>
|
||||
bool UpsertAtsc3Held(HTMLEntryPackageType htmlEntryPackageType);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1788,6 +1788,11 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.Filesystem
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool UpsertAtsc3Held(HTMLEntryPackageType htmlEntryPackageType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public RfSpectrumData GetRfSpectrum(Guid jobGuid)
|
||||
{
|
||||
string filename = Path.Combine(rootDirectory.FullName, "rf", jobGuid.ToString() + ".rf");
|
||||
|
||||
@ -1905,5 +1905,22 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.InMemory
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private Dictionary<string, HTMLEntryPackageType> _atsc3Helds;
|
||||
public bool UpsertAtsc3Held(HTMLEntryPackageType htmlEntryPackageType)
|
||||
{
|
||||
if (_atsc3Helds == null)
|
||||
_atsc3Helds = new Dictionary<string, HTMLEntryPackageType>();
|
||||
|
||||
if (_atsc3Helds.ContainsKey(htmlEntryPackageType.appContextId))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_atsc3Helds.Add(htmlEntryPackageType.appContextId, htmlEntryPackageType);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user