From f693fbf92d4bddc425c085ae8deb194664691f26 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 14 Mar 2018 23:08:43 +0900 Subject: [PATCH] Add forward snapping from inbetween beat test --- .../Visual/TestCaseEditorSeekSnapping.cs | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseEditorSeekSnapping.cs b/osu.Game.Tests/Visual/TestCaseEditorSeekSnapping.cs index 36319c0f71..4757e6c857 100644 --- a/osu.Game.Tests/Visual/TestCaseEditorSeekSnapping.cs +++ b/osu.Game.Tests/Visual/TestCaseEditorSeekSnapping.cs @@ -75,7 +75,8 @@ namespace osu.Game.Tests.Visual // testSeekSnappingOnBeat(); // testSeekSnappingInBetweenBeat(); // testSeekForwardNoSnapping(); - testSeekForwardSnappingOnBeat(); +// testSeekForwardSnappingOnBeat(); + testSeekForwardSnappingFromInBetweenBeat(); } /// @@ -189,14 +190,36 @@ namespace osu.Game.Tests.Visual /// /// Tests that when seeking forward from in-between two beats, the next beat or timing point is snapped to, and no beats are skipped. + /// This will also test being extremely close to the next beat/timing point, to ensure rounding is not an issue. /// private void testSeekForwardSnappingFromInBetweenBeat() { reset(); - AddStep("Seek(25)", () => composer.SeekTo(25)); + AddStep("Seek(49)", () => composer.SeekTo(49)); AddStep("SeekForward", () => composer.SeekForward(true)); AddAssert("Time = 50", () => track.CurrentTime == 50); + AddStep("Seek(49.999)", () => composer.SeekTo(49.999)); + AddStep("SeekForward", () => composer.SeekForward(true)); + AddAssert("Time = 50", () => track.CurrentTime == 50); + AddStep("Seek(99)", () => composer.SeekTo(99)); + AddStep("SeekForward", () => composer.SeekForward(true)); + AddAssert("Time = 100", () => track.CurrentTime == 100); + AddStep("Seek(99.999)", () => composer.SeekTo(99.999)); + AddStep("SeekForward", () => composer.SeekForward(true)); + AddAssert("Time = 100", () => track.CurrentTime == 100); + AddStep("Seek(174)", () => composer.SeekTo(174)); + AddStep("SeekForward", () => composer.SeekForward(true)); + AddAssert("Time = 175", () => track.CurrentTime == 175); + AddStep("Seek(349)", () => composer.SeekTo(349)); + AddStep("SeekForward", () => composer.SeekForward(true)); + AddAssert("Time = 350", () => track.CurrentTime == 350); + AddStep("Seek(399)", () => composer.SeekTo(399)); + AddStep("SeekForward", () => composer.SeekForward(true)); + AddAssert("Time = 400", () => track.CurrentTime == 400); + AddStep("Seek(449)", () => composer.SeekTo(449)); + AddStep("SeekForward", () => composer.SeekForward(true)); + AddAssert("Time = 450", () => track.CurrentTime == 450); } private void reset()