Fix unrelated tests

This commit is contained in:
ansel 2023-01-12 03:39:27 +03:00
parent 51e21ee6f0
commit e8029e6390
2 changed files with 5 additions and 5 deletions

View File

@ -17,7 +17,7 @@ namespace osu.Game.Tests.NonVisual
public void TestExactDivisors() public void TestExactDivisors()
{ {
var cpi = new ControlPointInfo(); var cpi = new ControlPointInfo();
cpi.Add(-1000, new TimingControlPoint { BeatLength = 1000 }); cpi.Add(0, new TimingControlPoint { BeatLength = 1000 });
double[] divisors = { 3, 1, 16, 12, 8, 6, 4, 3, 2, 1 }; double[] divisors = { 3, 1, 16, 12, 8, 6, 4, 3, 2, 1 };
@ -47,7 +47,7 @@ namespace osu.Game.Tests.NonVisual
public void TestExactDivisorsHighBPMStream() public void TestExactDivisorsHighBPMStream()
{ {
var cpi = new ControlPointInfo(); var cpi = new ControlPointInfo();
cpi.Add(-50, new TimingControlPoint { BeatLength = 50 }); // 1200 BPM 1/4 (limit testing) cpi.Add(0, new TimingControlPoint { BeatLength = 50 }); // 1200 BPM 1/4 (limit testing)
// A 1/4 stream should land on 1/1, 1/2 and 1/4 divisors. // A 1/4 stream should land on 1/1, 1/2 and 1/4 divisors.
double[] divisors = { 4, 4, 4, 4, 4, 4, 4, 4 }; double[] divisors = { 4, 4, 4, 4, 4, 4, 4, 4 };
@ -60,7 +60,7 @@ namespace osu.Game.Tests.NonVisual
public void TestApproximateDivisors() public void TestApproximateDivisors()
{ {
var cpi = new ControlPointInfo(); var cpi = new ControlPointInfo();
cpi.Add(-1000, new TimingControlPoint { BeatLength = 1000 }); cpi.Add(0, new TimingControlPoint { BeatLength = 1000 });
double[] divisors = { 3.03d, 0.97d, 14, 13, 7.94d, 6.08d, 3.93d, 2.96d, 2.02d, 64 }; double[] divisors = { 3.03d, 0.97d, 14, 13, 7.94d, 6.08d, 3.93d, 2.96d, 2.02d, 64 };
double[] closestDivisors = { 3, 1, 16, 12, 8, 6, 4, 3, 2, 1 }; double[] closestDivisors = { 3, 1, 16, 12, 8, 6, 4, 3, 2, 1 };
@ -68,7 +68,7 @@ namespace osu.Game.Tests.NonVisual
assertClosestDivisors(divisors, closestDivisors, cpi); assertClosestDivisors(divisors, closestDivisors, cpi);
} }
private void assertClosestDivisors(IReadOnlyList<double> divisors, IReadOnlyList<double> closestDivisors, ControlPointInfo cpi, double step = 1) private static void assertClosestDivisors(IReadOnlyList<double> divisors, IReadOnlyList<double> closestDivisors, ControlPointInfo cpi, double step = 1)
{ {
List<HitObject> hitobjects = new List<HitObject>(); List<HitObject> hitobjects = new List<HitObject>();
double offset = cpi.TimingPoints[0].Time; double offset = cpi.TimingPoints[0].Time;

View File

@ -144,7 +144,7 @@ namespace osu.Game.Tests.Visual.Editing
double lastStarRating = 0; double lastStarRating = 0;
double lastLength = 0; double lastLength = 0;
AddStep("Add timing point", () => EditorBeatmap.ControlPointInfo.Add(500, new TimingControlPoint())); AddStep("Add timing point", () => EditorBeatmap.ControlPointInfo.Add(200, new TimingControlPoint { BeatLength = 600 }));
AddStep("Change to placement mode", () => InputManager.Key(Key.Number2)); AddStep("Change to placement mode", () => InputManager.Key(Key.Number2));
AddStep("Move to playfield", () => InputManager.MoveMouseTo(Game.ScreenSpaceDrawQuad.Centre)); AddStep("Move to playfield", () => InputManager.MoveMouseTo(Game.ScreenSpaceDrawQuad.Centre));
AddStep("Place single hitcircle", () => InputManager.Click(MouseButton.Left)); AddStep("Place single hitcircle", () => InputManager.Click(MouseButton.Left));