1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:07:52 +08:00

Add test coverage of expected behaviour for playback of loops with no explicit end time

This commit is contained in:
Dean Herbert 2023-04-25 15:14:32 +09:00
parent 3919400be2
commit dce0c5fac8
2 changed files with 25 additions and 0 deletions

View File

@ -95,6 +95,25 @@ namespace osu.Game.Tests.Beatmaps.Formats
}
}
[Test]
public void TestLoopWithoutExplicitFadeOut()
{
var decoder = new LegacyStoryboardDecoder();
using (var resStream = TestResources.OpenResource("animation-loop-no-explicit-end-time.osb"))
using (var stream = new LineBufferedReader(resStream))
{
var storyboard = decoder.Decode(stream);
StoryboardLayer background = storyboard.Layers.Single(l => l.Depth == 3);
Assert.AreEqual(1, background.Elements.Count);
Assert.AreEqual(2000, background.Elements[0].StartTime);
Assert.AreEqual(2000, (background.Elements[0] as StoryboardAnimation)?.EarliestTransformTime);
Assert.AreEqual(12000, (background.Elements[0] as StoryboardAnimation)?.GetEndTime());
}
}
[Test]
public void TestCorrectAnimationStartTime()
{

View File

@ -0,0 +1,6 @@
[Events]
//Storyboard Layer 0 (Background)
Animation,Background,Centre,"img.jpg",320,240,2,150,LoopForever
F,0,2000,,0,1
L,2000,10
F,18,0,1000,1,0