mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 20:22:55 +08:00
Add some more tests
This commit is contained in:
parent
3f67538d61
commit
683ac6f63a
@ -25,11 +25,12 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
public partial class TestSceneSliderEarlyHitJudgement : RateAdjustedBeatmapTestScene
|
public partial class TestSceneSliderEarlyHitJudgement : RateAdjustedBeatmapTestScene
|
||||||
{
|
{
|
||||||
private const double time_slider_start = 1000;
|
private const double time_slider_start = 1000;
|
||||||
private const double time_slider_tick = 2000;
|
|
||||||
private const double time_slider_end = 3000;
|
private const double time_slider_end = 3000;
|
||||||
|
|
||||||
private static readonly Vector2 slider_start_position = new Vector2(256 - slider_path_length / 2, 192);
|
private static readonly Vector2 slider_start_position = new Vector2(256 - slider_path_length / 2, 192);
|
||||||
private static readonly Vector2 slider_end_position = new Vector2(256 + slider_path_length / 2, 192);
|
private static readonly Vector2 slider_end_position = new Vector2(256 + slider_path_length / 2, 192);
|
||||||
|
private static readonly Vector2 offset_inside_follow = new Vector2(35, 0);
|
||||||
|
private static readonly Vector2 offset_outside_follow = offset_inside_follow * 2;
|
||||||
|
|
||||||
private ScoreAccessibleReplayPlayer currentPlayer = null!;
|
private ScoreAccessibleReplayPlayer currentPlayer = null!;
|
||||||
|
|
||||||
@ -43,8 +44,8 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
performTest(new List<ReplayFrame>
|
performTest(new List<ReplayFrame>
|
||||||
{
|
{
|
||||||
new OsuReplayFrame(time_slider_start - 300, slider_start_position, OsuAction.LeftButton),
|
new OsuReplayFrame(time_slider_start - 300, slider_start_position, OsuAction.LeftButton),
|
||||||
new OsuReplayFrame(time_slider_start - 200, slider_start_position + new Vector2(32, 0), OsuAction.LeftButton),
|
new OsuReplayFrame(time_slider_start - 200, slider_start_position + offset_inside_follow, OsuAction.LeftButton),
|
||||||
new OsuReplayFrame(time_slider_end - 200, slider_end_position + new Vector2(32, 0), OsuAction.LeftButton),
|
new OsuReplayFrame(time_slider_end - 200, slider_end_position + offset_inside_follow, OsuAction.LeftButton),
|
||||||
});
|
});
|
||||||
|
|
||||||
assertHeadJudgement(HitResult.Miss);
|
assertHeadJudgement(HitResult.Miss);
|
||||||
@ -53,14 +54,49 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
assertSliderJudgement(HitResult.IgnoreHit);
|
assertSliderJudgement(HitResult.IgnoreHit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestHitEarlyAndReleaseInFollowRegion()
|
||||||
|
{
|
||||||
|
performTest(new List<ReplayFrame>
|
||||||
|
{
|
||||||
|
new OsuReplayFrame(time_slider_start - 300, slider_start_position, OsuAction.LeftButton),
|
||||||
|
new OsuReplayFrame(time_slider_start - 200, slider_start_position + offset_inside_follow, OsuAction.LeftButton),
|
||||||
|
new OsuReplayFrame(time_slider_start - 100, slider_start_position + offset_inside_follow),
|
||||||
|
new OsuReplayFrame(time_slider_end - 100, slider_end_position + offset_inside_follow, OsuAction.LeftButton),
|
||||||
|
});
|
||||||
|
|
||||||
|
assertHeadJudgement(HitResult.Miss);
|
||||||
|
assertTickJudgement(HitResult.LargeTickMiss);
|
||||||
|
assertTailJudgement(HitResult.IgnoreMiss);
|
||||||
|
assertSliderJudgement(HitResult.IgnoreMiss);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestHitEarlyAndRepressInFollowRegion()
|
||||||
|
{
|
||||||
|
performTest(new List<ReplayFrame>
|
||||||
|
{
|
||||||
|
new OsuReplayFrame(time_slider_start - 300, slider_start_position, OsuAction.LeftButton),
|
||||||
|
new OsuReplayFrame(time_slider_start - 200, slider_start_position + offset_inside_follow, OsuAction.LeftButton),
|
||||||
|
new OsuReplayFrame(time_slider_start - 100, slider_start_position + offset_inside_follow),
|
||||||
|
new OsuReplayFrame(time_slider_start - 50, slider_start_position + offset_inside_follow, OsuAction.LeftButton),
|
||||||
|
new OsuReplayFrame(time_slider_end - 50, slider_end_position + offset_inside_follow, OsuAction.LeftButton),
|
||||||
|
});
|
||||||
|
|
||||||
|
assertHeadJudgement(HitResult.Miss);
|
||||||
|
assertTickJudgement(HitResult.LargeTickMiss);
|
||||||
|
assertTailJudgement(HitResult.IgnoreMiss);
|
||||||
|
assertSliderJudgement(HitResult.IgnoreMiss);
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestHitEarlyMoveOutsideFollowRegion()
|
public void TestHitEarlyMoveOutsideFollowRegion()
|
||||||
{
|
{
|
||||||
performTest(new List<ReplayFrame>
|
performTest(new List<ReplayFrame>
|
||||||
{
|
{
|
||||||
new OsuReplayFrame(time_slider_start - 300, slider_start_position, OsuAction.LeftButton),
|
new OsuReplayFrame(time_slider_start - 300, slider_start_position, OsuAction.LeftButton),
|
||||||
new OsuReplayFrame(time_slider_start - 200, slider_start_position + new Vector2(96, 0), OsuAction.LeftButton),
|
new OsuReplayFrame(time_slider_start - 200, slider_start_position + offset_outside_follow, OsuAction.LeftButton),
|
||||||
new OsuReplayFrame(time_slider_end - 200, slider_end_position + new Vector2(96, 0), OsuAction.LeftButton),
|
new OsuReplayFrame(time_slider_end - 200, slider_end_position + offset_outside_follow, OsuAction.LeftButton),
|
||||||
});
|
});
|
||||||
|
|
||||||
assertHeadJudgement(HitResult.Miss);
|
assertHeadJudgement(HitResult.Miss);
|
||||||
|
Loading…
Reference in New Issue
Block a user