1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-14 19:53:08 +08:00

Fix final test

This looks to have been a WIP test, so I've brought it up to the point
of passing. I haven't given it much more attention than that, though.
This commit is contained in:
Dean Herbert 2023-10-17 19:12:12 +09:00
parent 9011170c3e
commit 80ac0c46d9
No known key found for this signature in database

View File

@ -162,13 +162,20 @@ namespace osu.Game.Rulesets.Osu.Tests
{
AddStep("set manual clock", () => manualClock = new ManualClock { Rate = 1 });
List<ReplayFrame> frames = new SpinFramesGenerator(time_spinner_start)
.Spin(360, 500) // 2000ms -> 1 full CW spin
.Spin(-180, 500) // 2500ms -> 0.5 CCW spins
.Spin(90, 500) // 3000ms -> 0.25 CW spins
.Spin(450, 500) // 3500ms -> 1 full CW spin
.Spin(180, 500) // 4000ms -> 0.5 CW spins
.Build();
List<ReplayFrame> frames =
new SpinFramesGenerator(time_spinner_start)
// 1500ms start
.Spin(360, 500)
// 2000ms -> 1 full CW spin
.Spin(-180, 500)
// 2500ms -> 1 full CW spin + 0.5 CCW spins
.Spin(90, 500)
// 3000ms -> 1 full CW spin + 0.25 CCW spins
.Spin(450, 500)
// 3500ms -> 2 full CW spins
.Spin(180, 500)
// 4000ms -> 2 full CW spins + 0.5 CW spins
.Build();
loadPlayer(frames);
@ -189,11 +196,11 @@ namespace osu.Game.Rulesets.Osu.Tests
assertTotalRotation(3750, 810);
assertTotalRotation(3500, 720);
assertTotalRotation(3250, 530);
assertTotalRotation(3000, 540);
assertTotalRotation(3000, 450);
assertTotalRotation(2750, 540);
assertTotalRotation(2500, 540);
assertTotalRotation(2250, 360);
assertTotalRotation(2000, 180);
assertTotalRotation(2250, 450);
assertTotalRotation(2000, 360);
assertTotalRotation(1500, 0);
void assertTotalRotation(double time, float expected)
@ -206,7 +213,8 @@ namespace osu.Game.Rulesets.Osu.Tests
void addSeekStep(double time)
{
AddStep($"seek to {time}", () => clock.Seek(time));
AddUntilStep("wait for seek to finish", () => drawableRuleset.FrameStableClock.CurrentTime, () => Is.EqualTo(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));
}
}