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

Update/remove determinant tests

We now only change the path type based on the bounding box.

If the control points are too linear, the framework now handles the fallback to Bezier.
This commit is contained in:
Naxess 2021-03-31 20:08:39 +02:00
parent 70d5b616f2
commit 1718084dbc
2 changed files with 5 additions and 37 deletions

View File

@ -61,19 +61,6 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor
assertControlPointType(0, PathType.PerfectCurve);
}
[Test]
public void TestDragControlPointAlmostLinearly()
{
moveMouseToControlPoint(1);
AddStep("hold", () => InputManager.PressButton(MouseButton.Left));
addMovementStep(new Vector2(150, 0.01f));
AddStep("release", () => InputManager.ReleaseButton(MouseButton.Left));
assertControlPointPosition(1, new Vector2(150, 0.01f));
assertControlPointType(0, PathType.Bezier);
}
[Test]
public void TestDragControlPointAlmostLinearlyExterior()
{
@ -93,7 +80,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor
moveMouseToControlPoint(1);
AddStep("hold", () => InputManager.PressButton(MouseButton.Left));
addMovementStep(new Vector2(150, 0.01f));
addMovementStep(new Vector2(400, 0.01f));
assertControlPointType(0, PathType.Bezier);
addMovementStep(new Vector2(150, 50));
@ -109,7 +96,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor
moveMouseToControlPoint(4);
AddStep("hold", () => InputManager.PressButton(MouseButton.Left));
addMovementStep(new Vector2(350, 0));
addMovementStep(new Vector2(350, 0.01f));
assertControlPointType(2, PathType.Bezier);
addMovementStep(new Vector2(150, 150));

View File

@ -276,25 +276,6 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor
assertControlPointType(0, PathType.Linear);
}
[Test]
public void TestPlacePerfectCurveSegmentAlmostLinearly()
{
Vector2 startPosition = new Vector2(200);
addMovementStep(startPosition);
addClickStep(MouseButton.Left);
addMovementStep(startPosition + new Vector2(61.382935f, 6.423767f));
addClickStep(MouseButton.Left);
addMovementStep(startPosition + new Vector2(217.69522f, 22.84021f));
addClickStep(MouseButton.Right);
assertPlaced(true);
assertControlPointCount(3);
assertControlPointType(0, PathType.Bezier);
}
[Test]
public void TestPlacePerfectCurveSegmentAlmostLinearlyExterior()
{
@ -322,10 +303,10 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor
addMovementStep(startPosition);
addClickStep(MouseButton.Left);
addMovementStep(startPosition + new Vector2(61.382935f, 6.423767f));
addMovementStep(startPosition + new Vector2(300, 0));
addClickStep(MouseButton.Left);
addMovementStep(startPosition + new Vector2(217.69522f, 22.84021f)); // Should convert to bezier
addMovementStep(startPosition + new Vector2(150, 0.1f)); // Should convert to bezier
addMovementStep(startPosition + new Vector2(210.0f, 0.0f)); // Should convert back to perfect
addClickStep(MouseButton.Right);
@ -346,7 +327,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor
addClickStep(MouseButton.Left);
// Playfield dimensions are 640 x 480.
// So a 480 * 480 bounding box area should be ok.
// So a 480 x 480 bounding box should be ok.
addMovementStep(startPosition + new Vector2(-240, 240));
addClickStep(MouseButton.Right);