mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
Add failing test case
This commit is contained in:
parent
fec3bd898e
commit
d7e5a21213
@ -129,5 +129,25 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
||||
Assert.AreEqual(3456, ((StoryboardSprite)background.Elements.Single()).InitialPosition.X);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestDecodeOutOfRangeLoopAnimationType()
|
||||
{
|
||||
var decoder = new LegacyStoryboardDecoder();
|
||||
|
||||
using (var resStream = TestResources.OpenResource("animation-types.osb"))
|
||||
using (var stream = new LineBufferedReader(resStream))
|
||||
{
|
||||
var storyboard = decoder.Decode(stream);
|
||||
|
||||
StoryboardLayer foreground = storyboard.Layers.Single(l => l.Depth == 0);
|
||||
Assert.AreEqual(AnimationLoopType.LoopForever, ((StoryboardAnimation)foreground.Elements[0]).LoopType);
|
||||
Assert.AreEqual(AnimationLoopType.LoopOnce, ((StoryboardAnimation)foreground.Elements[1]).LoopType);
|
||||
Assert.AreEqual(AnimationLoopType.LoopForever, ((StoryboardAnimation)foreground.Elements[2]).LoopType);
|
||||
Assert.AreEqual(AnimationLoopType.LoopOnce, ((StoryboardAnimation)foreground.Elements[3]).LoopType);
|
||||
Assert.AreEqual(AnimationLoopType.LoopForever, ((StoryboardAnimation)foreground.Elements[4]).LoopType);
|
||||
Assert.AreEqual(AnimationLoopType.LoopForever, ((StoryboardAnimation)foreground.Elements[5]).LoopType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
9
osu.Game.Tests/Resources/animation-types.osb
Normal file
9
osu.Game.Tests/Resources/animation-types.osb
Normal file
@ -0,0 +1,9 @@
|
||||
osu file format v14
|
||||
|
||||
[Events]
|
||||
Animation,Foreground,Centre,"forever-string.png",330,240,10,108,LoopForever
|
||||
Animation,Foreground,Centre,"once-string.png",330,240,10,108,LoopOnce
|
||||
Animation,Foreground,Centre,"forever-number.png",330,240,10,108,0
|
||||
Animation,Foreground,Centre,"once-number.png",330,240,10,108,1
|
||||
Animation,Foreground,Centre,"undefined-number.png",330,240,10,108,16
|
||||
Animation,Foreground,Centre,"omitted.png",330,240,10,108
|
Loading…
Reference in New Issue
Block a user