mirror of
https://github.com/ppy/osu
synced 2025-02-24 22:57:05 +00:00
Fix broken tests
This commit is contained in:
parent
064857c40b
commit
d123ba5bce
@ -20,7 +20,7 @@ namespace osu.Game.Tests.NonVisual.Ranking
|
|||||||
public void TestDistributedHits()
|
public void TestDistributedHits()
|
||||||
{
|
{
|
||||||
var events = Enumerable.Range(-5, 11)
|
var events = Enumerable.Range(-5, 11)
|
||||||
.Select(t => new HitEvent(t - 5, HitResult.Great, new HitObject(), null, null));
|
.Select(t => new HitEvent(t - 5, 1.0, HitResult.Great, new HitObject(), null, null));
|
||||||
|
|
||||||
var unstableRate = new UnstableRate(events);
|
var unstableRate = new UnstableRate(events);
|
||||||
|
|
||||||
@ -33,9 +33,9 @@ namespace osu.Game.Tests.NonVisual.Ranking
|
|||||||
{
|
{
|
||||||
var events = new[]
|
var events = new[]
|
||||||
{
|
{
|
||||||
new HitEvent(-100, HitResult.Miss, new HitObject(), null, null),
|
new HitEvent(-100, 1.0, HitResult.Miss, new HitObject(), null, null),
|
||||||
new HitEvent(0, HitResult.Great, new HitObject(), null, null),
|
new HitEvent(0, 1.0, HitResult.Great, new HitObject(), null, null),
|
||||||
new HitEvent(200, HitResult.Meh, new HitObject { HitWindows = HitWindows.Empty }, null, null),
|
new HitEvent(200, 1.0, HitResult.Meh, new HitObject { HitWindows = HitWindows.Empty }, null, null),
|
||||||
};
|
};
|
||||||
|
|
||||||
var unstableRate = new UnstableRate(events);
|
var unstableRate = new UnstableRate(events);
|
||||||
|
@ -56,6 +56,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
scoreProcessor.RevertResult(
|
scoreProcessor.RevertResult(
|
||||||
new JudgementResult(new HitCircle { HitWindows = hitWindows }, new Judgement())
|
new JudgementResult(new HitCircle { HitWindows = hitWindows }, new Judgement())
|
||||||
{
|
{
|
||||||
|
GameplayRate = 1.0,
|
||||||
TimeOffset = 25,
|
TimeOffset = 25,
|
||||||
Type = HitResult.Perfect,
|
Type = HitResult.Perfect,
|
||||||
});
|
});
|
||||||
@ -92,7 +93,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void applyJudgement(double offsetMs, bool alt)
|
private void applyJudgement(double offsetMs, bool alt, double gameplayRate = 1.0)
|
||||||
{
|
{
|
||||||
double placement = offsetMs;
|
double placement = offsetMs;
|
||||||
|
|
||||||
@ -105,6 +106,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
scoreProcessor.ApplyResult(new JudgementResult(new HitCircle { HitWindows = hitWindows }, new Judgement())
|
scoreProcessor.ApplyResult(new JudgementResult(new HitCircle { HitWindows = hitWindows }, new Judgement())
|
||||||
{
|
{
|
||||||
TimeOffset = placement,
|
TimeOffset = placement,
|
||||||
|
GameplayRate = gameplayRate,
|
||||||
Type = HitResult.Perfect,
|
Type = HitResult.Perfect,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ 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, placeholder_object, placeholder_object, null)).ToList());
|
createTest(Enumerable.Range(-150, 300).Select(i => new HitEvent(i / 50f, 1.0, HitResult.Perfect, placeholder_object, placeholder_object, null)).ToList());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -57,12 +57,12 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
{
|
{
|
||||||
createTest(new List<HitEvent>
|
createTest(new List<HitEvent>
|
||||||
{
|
{
|
||||||
new HitEvent(-7, HitResult.Perfect, placeholder_object, placeholder_object, null),
|
new HitEvent(-7, 1.0, HitResult.Perfect, placeholder_object, placeholder_object, null),
|
||||||
new HitEvent(-6, HitResult.Perfect, placeholder_object, placeholder_object, null),
|
new HitEvent(-6, 1.0, HitResult.Perfect, placeholder_object, placeholder_object, null),
|
||||||
new HitEvent(-5, HitResult.Perfect, placeholder_object, placeholder_object, null),
|
new HitEvent(-5, 1.0, HitResult.Perfect, placeholder_object, placeholder_object, null),
|
||||||
new HitEvent(5, HitResult.Perfect, placeholder_object, placeholder_object, null),
|
new HitEvent(5, 1.0, HitResult.Perfect, placeholder_object, placeholder_object, null),
|
||||||
new HitEvent(6, HitResult.Perfect, placeholder_object, placeholder_object, null),
|
new HitEvent(6, 1.0, HitResult.Perfect, placeholder_object, placeholder_object, null),
|
||||||
new HitEvent(7, HitResult.Perfect, placeholder_object, placeholder_object, null),
|
new HitEvent(7, 1.0, HitResult.Perfect, placeholder_object, placeholder_object, null),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
: offset > 16 ? HitResult.Good
|
: offset > 16 ? HitResult.Good
|
||||||
: offset > 8 ? HitResult.Great
|
: offset > 8 ? HitResult.Great
|
||||||
: HitResult.Perfect;
|
: HitResult.Perfect;
|
||||||
return new HitEvent(h.TimeOffset, result, placeholder_object, placeholder_object, null);
|
return new HitEvent(h.TimeOffset, 1.0, result, placeholder_object, placeholder_object, null);
|
||||||
}).ToList());
|
}).ToList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
: offset > 8 ? HitResult.Great
|
: offset > 8 ? HitResult.Great
|
||||||
: HitResult.Perfect;
|
: HitResult.Perfect;
|
||||||
|
|
||||||
return new HitEvent(h.TimeOffset, result, placeholder_object, placeholder_object, null);
|
return new HitEvent(h.TimeOffset, 1.0, result, placeholder_object, placeholder_object, null);
|
||||||
});
|
});
|
||||||
var narrow = CreateDistributedHitEvents(0, 50).Select(h =>
|
var narrow = CreateDistributedHitEvents(0, 50).Select(h =>
|
||||||
{
|
{
|
||||||
@ -106,7 +106,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
: offset > 10 ? HitResult.Good
|
: offset > 10 ? HitResult.Good
|
||||||
: offset > 5 ? HitResult.Great
|
: offset > 5 ? HitResult.Great
|
||||||
: HitResult.Perfect;
|
: HitResult.Perfect;
|
||||||
return new HitEvent(h.TimeOffset, result, placeholder_object, placeholder_object, null);
|
return new HitEvent(h.TimeOffset, 1.0, result, placeholder_object, placeholder_object, null);
|
||||||
});
|
});
|
||||||
createTest(wide.Concat(narrow).ToList());
|
createTest(wide.Concat(narrow).ToList());
|
||||||
}
|
}
|
||||||
@ -114,7 +114,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestZeroTimeOffset()
|
public void TestZeroTimeOffset()
|
||||||
{
|
{
|
||||||
createTest(Enumerable.Range(0, 100).Select(_ => new HitEvent(0, HitResult.Perfect, placeholder_object, placeholder_object, null)).ToList());
|
createTest(Enumerable.Range(0, 100).Select(_ => new HitEvent(0, 1.0, HitResult.Perfect, placeholder_object, placeholder_object, null)).ToList());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -129,9 +129,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, placeholder_object, placeholder_object, null);
|
return new HitEvent(0, 1.0, HitResult.Perfect, placeholder_object, placeholder_object, null);
|
||||||
|
|
||||||
return new HitEvent(30, HitResult.Miss, placeholder_object, placeholder_object, null);
|
return new HitEvent(30, 1.0, HitResult.Miss, placeholder_object, placeholder_object, null);
|
||||||
}).ToList());
|
}).ToList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
int count = (int)(Math.Pow(range - Math.Abs(i - range), 2)) / 10;
|
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, placeholder_object, placeholder_object, null));
|
hitEvents.Add(new HitEvent(centre + i - range, 1.0, HitResult.Perfect, placeholder_object, placeholder_object, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
return hitEvents;
|
return hitEvents;
|
||||||
|
Loading…
Reference in New Issue
Block a user