1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-22 21:00:58 +08:00

Set ManualClock rate to 0 to avoid interpolation causing test errors

This commit is contained in:
Dean Herbert
2023-10-23 20:28:12 +09:00
Unverified
parent 08b7c3d5ad
commit 15c1fcbf96
2 changed files with 8 additions and 2 deletions
@@ -160,7 +160,11 @@ namespace osu.Game.Rulesets.Osu.Tests
[Test]
public void TestRewind()
{
AddStep("set manual clock", () => manualClock = new ManualClock { Rate = 1 });
AddStep("set manual clock", () => manualClock = new ManualClock
{
// Avoids interpolation trying to run ahead during testing.
Rate = 0
});
List<ReplayFrame> frames =
new SpinFramesGenerator(time_spinner_start)
@@ -214,7 +218,7 @@ namespace osu.Game.Rulesets.Osu.Tests
{
AddStep($"seek to {time}", () => clock.Seek(time));
// Lenience is required due to interpolation running slightly ahead on a stalled clock.
AddUntilStep("wait for seek to finish", () => drawableRuleset.FrameStableClock.CurrentTime, () => Is.EqualTo(time).Within(40));
AddUntilStep("wait for seek to finish", () => drawableRuleset.FrameStableClock.CurrentTime, () => Is.EqualTo(time));
}
}
+2
View File
@@ -432,6 +432,8 @@ namespace osu.Game.Tests.Visual
private bool running;
public override double Rate => referenceClock.Rate;
public TrackVirtualManual(IFrameBasedClock referenceClock, string name = "virtual")
: base(name)
{