mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 23:12:56 +08:00
Add testing for actual presence of video after encode-decode
This commit is contained in:
parent
fd3f4a9e7b
commit
19897c4c07
@ -25,6 +25,7 @@ using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Rulesets.Taiko;
|
||||
using osu.Game.Skinning;
|
||||
using osu.Game.Storyboards;
|
||||
using osu.Game.Tests.Resources;
|
||||
using osuTK;
|
||||
|
||||
@ -43,13 +44,14 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
||||
const string name = "Resources/storyboard_only_video.osu";
|
||||
|
||||
var decoded = decodeFromLegacy(beatmaps_resource_store.GetStream(name), name);
|
||||
var decodedAfterEncode = decodeFromLegacy(encodeToLegacy(decoded), name);
|
||||
|
||||
Assert.That(decoded.beatmap.UnhandledEventLines.Count, Is.EqualTo(1));
|
||||
Assert.That(decoded.beatmap.UnhandledEventLines.Single(), Is.EqualTo("Video,0,\"video.avi\""));
|
||||
|
||||
Assert.That(decodedAfterEncode.beatmap.UnhandledEventLines.Count, Is.EqualTo(1));
|
||||
Assert.That(decodedAfterEncode.beatmap.UnhandledEventLines.Single(), Is.EqualTo("Video,0,\"video.avi\""));
|
||||
var memoryStream = encodeToLegacy(decoded);
|
||||
|
||||
var storyboard = new LegacyStoryboardDecoder().Decode(new LineBufferedReader(memoryStream));
|
||||
StoryboardLayer video = storyboard.Layers.Single(l => l.Name == "Video");
|
||||
Assert.That(video.Elements.Count, Is.EqualTo(1));
|
||||
}
|
||||
|
||||
[TestCaseSource(nameof(allBeatmaps))]
|
||||
|
Loading…
Reference in New Issue
Block a user