mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 13:23:22 +08:00
Set ManualClock
rate to 0 to avoid interpolation causing test errors
This commit is contained in:
parent
08b7c3d5ad
commit
15c1fcbf96
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user