mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-26 05:02:36 +01:00
Working on mkv unit tests
This commit is contained in:
parent
36a5917646
commit
895a461eee
BIN
src/Test/Files/sample_MKV_VobSub_PGS.mkv
Normal file
BIN
src/Test/Files/sample_MKV_VobSub_PGS.mkv
Normal file
Binary file not shown.
@ -56,5 +56,37 @@ namespace Test.Logic.VideoFormats
|
|||||||
parser.Dispose();
|
parser.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void MatroskaTestVobSubPgs()
|
||||||
|
{
|
||||||
|
string fileName = Path.Combine(Directory.GetCurrentDirectory(), "sample_MKV_VobSub_PGS.mkv");
|
||||||
|
var parser = new Nikse.SubtitleEdit.Logic.VideoFormats.Matroska(fileName);
|
||||||
|
|
||||||
|
bool isValid;
|
||||||
|
var tracks = parser.GetMatroskaSubtitleTracks(fileName, out isValid);
|
||||||
|
Assert.IsTrue(tracks[0].CodecId == "S_VOBSUB");
|
||||||
|
Assert.IsTrue(tracks[1].CodecId == "S_HDMV/PGS");
|
||||||
|
parser.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void MatroskaTestVobSubPgsContent()
|
||||||
|
{
|
||||||
|
string fileName = Path.Combine(Directory.GetCurrentDirectory(), "sample_MKV_VobSub_PGS.mkv");
|
||||||
|
var parser = new Nikse.SubtitleEdit.Logic.VideoFormats.Matroska(fileName);
|
||||||
|
|
||||||
|
bool isValid;
|
||||||
|
var tracks = parser.GetMatroskaSubtitleTracks(fileName, out isValid);
|
||||||
|
var subtitles = parser.GetMatroskaSubtitle(fileName, Convert.ToInt32(tracks[0].TrackNumber), out isValid, null);
|
||||||
|
Assert.IsTrue(subtitles.Count == 2);
|
||||||
|
//TODO: check bitmaps
|
||||||
|
|
||||||
|
//subtitles = parser.GetMatroskaSubtitle(fileName, Convert.ToInt32(tracks[1].TrackNumber), out isValid, null);
|
||||||
|
//Assert.IsTrue(subtitles.Count == 2);
|
||||||
|
//check bitmaps
|
||||||
|
|
||||||
|
parser.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,6 +78,9 @@
|
|||||||
<Content Include="Files\sample_MKV_SRT.mkv">
|
<Content Include="Files\sample_MKV_SRT.mkv">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="Files\sample_MKV_VobSub_PGS.mkv">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="Files\sample_TS_with_graphics.ts">
|
<Content Include="Files\sample_TS_with_graphics.ts">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
Loading…
Reference in New Issue
Block a user