2021-01-23 14:22:18 +01:00
|
|
|
|
using ChanSort.Loader.Samsung.Scm;
|
2015-11-27 23:47:09 +01:00
|
|
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
|
|
|
2021-01-23 14:22:18 +01:00
|
|
|
|
namespace Test.Loader.Samsung.Scm
|
2015-11-27 23:47:09 +01:00
|
|
|
|
{
|
|
|
|
|
|
[TestClass]
|
|
|
|
|
|
public class FileFormatDetectionTest
|
|
|
|
|
|
{
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
|
public void LoadFileWithExcessiveHighFrequency_1()
|
|
|
|
|
|
{
|
|
|
|
|
|
// this seems to be a corrupt file caused by a buffer-overflow from analog channel names into the frequency data bytes
|
2021-01-23 14:22:18 +01:00
|
|
|
|
var tempFile = TestUtils.DeploymentItem("Test.Loader.Samsung\\Scm\\TestFiles\\channel_list_UE55H6470_1201-Suchlauf-2015-04-26.scm");
|
2019-11-08 02:31:44 +01:00
|
|
|
|
var s = new ScmSerializer(tempFile);
|
2015-11-27 23:47:09 +01:00
|
|
|
|
s.Load();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
|
public void LoadFileWithExcessiveHighFrequency_2()
|
|
|
|
|
|
{
|
|
|
|
|
|
// this seems to be a corrupt file caused by a buffer-overflow from analog channel names into the frequency data bytes
|
2021-01-23 14:22:18 +01:00
|
|
|
|
var tempFile = TestUtils.DeploymentItem("Test.Loader.Samsung\\Scm\\TestFiles\\channel_list_UE55H6470_1201.scm");
|
2019-11-08 02:31:44 +01:00
|
|
|
|
var s = new ScmSerializer(tempFile);
|
2015-11-27 23:47:09 +01:00
|
|
|
|
s.Load();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
|
public void LoadRenamedFile_HE40Cxxx_1201()
|
|
|
|
|
|
{
|
|
|
|
|
|
// This file uses the 1201 format (E,F,H,J), but has a "C" in its model name
|
2021-01-23 14:22:18 +01:00
|
|
|
|
var tempFile = TestUtils.DeploymentItem("Test.Loader.Samsung\\Scm\\TestFiles\\E_format_with_C_model_name.scm");
|
2019-11-08 02:31:44 +01:00
|
|
|
|
var s = new ScmSerializer(tempFile);
|
2015-11-27 23:47:09 +01:00
|
|
|
|
s.Load();
|
2015-11-29 20:36:56 +01:00
|
|
|
|
Assert.AreEqual("E", s.Series);
|
2015-11-27 23:47:09 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
|
public void LoadRenamedFile_LT24B_1201()
|
|
|
|
|
|
{
|
|
|
|
|
|
// This file uses the 1201 format (E,F,H,J), but has a "B" in its model name
|
2021-01-23 14:22:18 +01:00
|
|
|
|
var tempFile = TestUtils.DeploymentItem("Test.Loader.Samsung\\Scm\\TestFiles\\E_format_with_B_model_name.scm");
|
2019-11-08 02:31:44 +01:00
|
|
|
|
var s = new ScmSerializer(tempFile);
|
2015-11-27 23:47:09 +01:00
|
|
|
|
s.Load();
|
2015-11-29 20:36:56 +01:00
|
|
|
|
Assert.AreEqual("E", s.Series);
|
2015-11-27 23:47:09 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2015-11-28 20:50:52 +01:00
|
|
|
|
[TestMethod]
|
|
|
|
|
|
public void LoadJSeriesWithScm1201Format()
|
|
|
|
|
|
{
|
2017-06-08 20:01:42 +02:00
|
|
|
|
// J-series model with E-J series SCM format
|
2021-01-23 14:22:18 +01:00
|
|
|
|
var tempFile = TestUtils.DeploymentItem("Test.Loader.Samsung\\Scm\\TestFiles\\channel_list_UE32J5170_1201_orig.scm");
|
2019-11-08 02:31:44 +01:00
|
|
|
|
var s = new ScmSerializer(tempFile);
|
2015-11-28 20:50:52 +01:00
|
|
|
|
s.Load();
|
2015-11-29 20:36:56 +01:00
|
|
|
|
Assert.AreEqual("E", s.Series);
|
2015-11-28 20:50:52 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2015-11-27 23:47:09 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|