mirror of
https://github.com/PredatH0r/ChanSort.git
synced 2026-02-20 21:36:49 +01:00
- LG GlobalClone 200 Json Serializer for WebOS 5.0 didn't add the 0x4000 to radio program numbers when saving the file
- aded NUnit test to compare original and modified file and ensure only expected changes are made - added DevExpress Data.Desktop DLL is now with 20.1 to start the application
This commit is contained in:
@@ -212,7 +212,10 @@ namespace ChanSort.Loader.GlobalClone
|
||||
}
|
||||
|
||||
node["deleted"] = ch.IsDeleted;
|
||||
node["majorNumber"] = Math.Max(ch.NewProgramNr, 0);
|
||||
var nr = Math.Max(ch.NewProgramNr, 0); // radio channels, except the deleted ones with Nr 0, have 0x4000 added to their number
|
||||
if (nr != 0 && (ch.SignalSource & SignalSource.Radio) != 0)
|
||||
nr |= 0x4000;
|
||||
node["majorNumber"] = nr;
|
||||
node["skipped"] = ch.Skip;
|
||||
node["locked"] = ch.Lock;
|
||||
node["Invisible"] = ch.Hidden;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using ChanSort.Api;
|
||||
using ChanSort.Loader.GlobalClone;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@@ -105,5 +106,60 @@ namespace Test.Loader.GlobalClone
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region TestGlobalClone200JsonFormat
|
||||
|
||||
[TestMethod]
|
||||
public void TestGlobalClone200JsonFormat()
|
||||
{
|
||||
var tempFile = TestUtils.DeploymentItem("Test.Loader.GlobalClone\\TestFiles\\GlobalClone00201.TLL");
|
||||
var orig = File.ReadAllText(tempFile, Encoding.UTF8);
|
||||
|
||||
var plugin = new GcSerializerPlugin();
|
||||
var ser = plugin.CreateSerializer(tempFile);
|
||||
ser.Load();
|
||||
var data = ser.DataRoot;
|
||||
data.ValidateAfterLoad();
|
||||
data.ApplyCurrentProgramNumbers();
|
||||
var dvbs = data.GetChannelList(SignalSource.DvbS);
|
||||
|
||||
// swap SRF 1 HD and SRF zwei HD
|
||||
var srf1 = dvbs.Channels.FirstOrDefault(ch => ch.Name == "SRF 1 HD");
|
||||
var srf2 = dvbs.Channels.FirstOrDefault(ch => ch.Name == "SRF zwei HD");
|
||||
Assert.AreEqual(1971, srf1.NewProgramNr);
|
||||
Assert.AreEqual(1972, srf2.NewProgramNr);
|
||||
srf1.NewProgramNr = 1972;
|
||||
srf2.NewProgramNr = 1971;
|
||||
|
||||
// save and reload
|
||||
ser.Save(tempFile);
|
||||
ser = plugin.CreateSerializer(tempFile);
|
||||
ser.Load();
|
||||
data = ser.DataRoot;
|
||||
data.ValidateAfterLoad();
|
||||
data.ApplyCurrentProgramNumbers();
|
||||
|
||||
dvbs = data.GetChannelList(SignalSource.DvbS);
|
||||
srf1 = dvbs.Channels.FirstOrDefault(ch => ch.Name == "SRF 1 HD");
|
||||
srf2 = dvbs.Channels.FirstOrDefault(ch => ch.Name == "SRF zwei HD");
|
||||
Assert.AreEqual(1972, srf1.OldProgramNr);
|
||||
Assert.AreEqual(1971, srf2.OldProgramNr);
|
||||
|
||||
// restore original program numbers and save
|
||||
srf1.NewProgramNr = 1971;
|
||||
srf2.NewProgramNr = 1972;
|
||||
ser.Save(tempFile);
|
||||
|
||||
// undo expected changes to the file
|
||||
var changed = File.ReadAllText(tempFile, Encoding.UTF8);
|
||||
changed = changed.Replace("\"userEditChNumber\":true", "\"userEditChNumber\":false");
|
||||
changed = changed.Replace("\"userSelCHNo\":true", "\"userSelCHNo\":false");
|
||||
NUnit.Framework.Assert.AreEqual(orig, changed); // need NUnit.AreEqual to only show the actual difference and not 5MB + 5MB of data
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" />
|
||||
<Import Project="..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
@@ -61,6 +62,9 @@
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
</ItemGroup>
|
||||
@@ -73,6 +77,7 @@
|
||||
<None Include="TestFiles\GlobalClone00001.TLL" />
|
||||
<None Include="TestFiles\GlobalClone00002.TLL" />
|
||||
<None Include="TestFiles\GlobalClone00003.TLL" />
|
||||
<None Include="TestFiles\GlobalClone00201.TLL" />
|
||||
<None Include="TestFiles\GlobalClone200-inner.json" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -97,6 +102,7 @@
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props'))" />
|
||||
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.12.0\build\NUnit.props'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets')" />
|
||||
</Project>
|
||||
File diff suppressed because one or more lines are too long
@@ -2,4 +2,5 @@
|
||||
<packages>
|
||||
<package id="MSTest.TestAdapter" version="1.3.2" targetFramework="net48" />
|
||||
<package id="MSTest.TestFramework" version="1.3.2" targetFramework="net48" />
|
||||
<package id="NUnit" version="3.12.0" targetFramework="net48" />
|
||||
</packages>
|
||||
@@ -1,6 +1,9 @@
|
||||
ChanSort Change Log
|
||||
===================
|
||||
|
||||
2020-05-15
|
||||
- fixed more issues with the LG WebOS 5.0 format
|
||||
|
||||
2020-05-11
|
||||
- improved support for LG OLED series (CX) - now supports lists with multiple sources (DVB-C, DVB-S), but still no favorite lists
|
||||
- added info screen when opening an empty LG channel list which is most likely caused by selecting a predefined list
|
||||
|
||||
@@ -24,7 +24,7 @@ mkdir "%target%\ReferenceLists" 2>nul
|
||||
xcopy /sidy ChanSort\ReferenceLists\* "%target%\ReferenceLists"
|
||||
xcopy /y ..\readme.md "%target%\readme.txt"
|
||||
xcopy /y changelog.md "%target%\changelog.txt"
|
||||
for %%f in (Utils Data DataAccess Printing XtraPrinting XtraReports XtraEditors XtraBars XtraGrid XtraLayout XtraTreeList) do call :copyDll %%f
|
||||
for %%f in (Utils Data Data.Desktop DataAccess Printing XtraPrinting XtraReports XtraEditors XtraBars XtraGrid XtraLayout XtraTreeList) do call :copyDll %%f
|
||||
call :CodeSigning
|
||||
|
||||
cd ..
|
||||
|
||||
Reference in New Issue
Block a user