mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Decrease overhead of hit event distribution tests
This commit is contained in:
@ -8,6 +8,7 @@ using NUnit.Framework;
|
|||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Screens.Ranking.Statistics;
|
using osu.Game.Screens.Ranking.Statistics;
|
||||||
@ -19,6 +20,8 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
{
|
{
|
||||||
private HitEventTimingDistributionGraph graph;
|
private HitEventTimingDistributionGraph graph;
|
||||||
|
|
||||||
|
private static readonly HitObject placeholder_object = new HitCircle();
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestManyDistributedEvents()
|
public void TestManyDistributedEvents()
|
||||||
{
|
{
|
||||||
@ -35,13 +38,13 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestAroundCentre()
|
public void TestAroundCentre()
|
||||||
{
|
{
|
||||||
createTest(Enumerable.Range(-150, 300).Select(i => new HitEvent(i / 50f, HitResult.Perfect, new HitCircle(), new HitCircle(), null)).ToList());
|
createTest(Enumerable.Range(-150, 300).Select(i => new HitEvent(i / 50f, HitResult.Perfect, placeholder_object, placeholder_object, null)).ToList());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestZeroTimeOffset()
|
public void TestZeroTimeOffset()
|
||||||
{
|
{
|
||||||
createTest(Enumerable.Range(0, 100).Select(_ => new HitEvent(0, HitResult.Perfect, new HitCircle(), new HitCircle(), null)).ToList());
|
createTest(Enumerable.Range(0, 100).Select(_ => new HitEvent(0, HitResult.Perfect, placeholder_object, placeholder_object, null)).ToList());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -56,9 +59,9 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
createTest(Enumerable.Range(0, 100).Select(i =>
|
createTest(Enumerable.Range(0, 100).Select(i =>
|
||||||
{
|
{
|
||||||
if (i % 2 == 0)
|
if (i % 2 == 0)
|
||||||
return new HitEvent(0, HitResult.Perfect, new HitCircle(), new HitCircle(), null);
|
return new HitEvent(0, HitResult.Perfect, placeholder_object, placeholder_object, null);
|
||||||
|
|
||||||
return new HitEvent(30, HitResult.Miss, new HitCircle(), new HitCircle(), null);
|
return new HitEvent(30, HitResult.Miss, placeholder_object, placeholder_object, null);
|
||||||
}).ToList());
|
}).ToList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,10 +89,10 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
|
|
||||||
for (int i = 0; i < range * 2; i++)
|
for (int i = 0; i < range * 2; i++)
|
||||||
{
|
{
|
||||||
int count = (int)(Math.Pow(range - Math.Abs(i - range), 2));
|
int count = (int)(Math.Pow(range - Math.Abs(i - range), 2)) / 10;
|
||||||
|
|
||||||
for (int j = 0; j < count; j++)
|
for (int j = 0; j < count; j++)
|
||||||
hitEvents.Add(new HitEvent(centre + i - range, HitResult.Perfect, new HitCircle(), new HitCircle(), null));
|
hitEvents.Add(new HitEvent(centre + i - range, HitResult.Perfect, placeholder_object, placeholder_object, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
return hitEvents;
|
return hitEvents;
|
||||||
|
Reference in New Issue
Block a user