1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 20:07:25 +08:00

Add sample trigger tests covering rewinding of gameplay

This commit is contained in:
Dean Herbert 2023-07-06 17:33:47 +09:00
parent 001d09057e
commit 7a3a14e50d

View File

@ -107,7 +107,7 @@ namespace osu.Game.Tests.Visual.Gameplay
{ {
base.SetUpSteps(); base.SetUpSteps();
AddStep("Add trigger source", () => Player.GameplayClockContainer.Add(sampleTriggerSource = new TestGameplaySampleTriggerSource(Player.DrawableRuleset.Playfield.HitObjectContainer))); AddStep("Add trigger source", () => Player.DrawableRuleset.FrameStableComponents.Add(sampleTriggerSource = new TestGameplaySampleTriggerSource(Player.DrawableRuleset.Playfield.HitObjectContainer)));
} }
[Test] [Test]
@ -153,6 +153,14 @@ namespace osu.Game.Tests.Visual.Gameplay
waitForAliveObjectIndex(2); waitForAliveObjectIndex(2);
checkValidObjectIndex(2); checkValidObjectIndex(2);
// test rewinding
seekBeforeIndex(1);
waitForAliveObjectIndex(1);
checkValidObjectIndex(1);
seekBeforeIndex(1, 400);
checkValidObjectIndex(0);
seekBeforeIndex(3); seekBeforeIndex(3);
waitForAliveObjectIndex(3); waitForAliveObjectIndex(3);
checkValidObjectIndex(3); checkValidObjectIndex(3);