1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

Add test ensuring correct SPM calculation on rewinding

This commit is contained in:
Salman Ahmed 2019-12-18 03:08:05 +03:00
parent 12a02cf6d9
commit f359a79b7e

View File

@ -70,6 +70,19 @@ namespace osu.Game.Rulesets.Osu.Tests
AddAssert("is rotation absolute almost same", () => Precision.AlmostEquals(drawableSpinner.Disc.RotationAbsolute, estimatedRotation, 100));
}
[Test]
public void TestSpinPerMinuteOnRewind()
{
double estimatedSpm = 0;
addSeekStep(2500);
AddStep("retrieve spm", () => estimatedSpm = drawableSpinner.SpmCounter.SpinsPerMinute);
addSeekStep(5000);
addSeekStep(2500);
AddAssert("is spm almost same", () => Precision.AlmostEquals(drawableSpinner.SpmCounter.SpinsPerMinute, estimatedSpm, 1.0));
}
private void addSeekStep(double time)
{
AddStep($"seek to {time}", () => track.Seek(time));