1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

Fix failing taiko tests

Non-pooled DHO is now not eagerly loaded
This commit is contained in:
ekrctb 2021-04-18 21:46:30 +09:00
parent 799d2a3300
commit 971ca39826
2 changed files with 16 additions and 12 deletions

View File

@ -20,20 +20,19 @@ namespace osu.Game.Rulesets.Taiko.Tests
[TestCase(HitType.Rim)] [TestCase(HitType.Rim)]
public void TestFlyingHits(HitType hitType) public void TestFlyingHits(HitType hitType)
{ {
DrawableFlyingHit flyingHit = null;
AddStep("add flying hit", () => AddStep("add flying hit", () =>
{ {
addFlyingHit(hitType); addFlyingHit(hitType);
// flying hits all land in one common scrolling container (and stay there for rewind purposes),
// so we need to manually get the latest one.
flyingHit = this.ChildrenOfType<DrawableFlyingHit>()
.OrderByDescending(h => h.HitObject.StartTime)
.FirstOrDefault();
}); });
AddAssert("hit type is correct", () => flyingHit.HitObject.Type == hitType); AddAssert("hit type is correct", () =>
{
// flying hits all land in one common scrolling container (and stay there for rewind purposes),
// so we need to manually get the latest one.
return this.ChildrenOfType<DrawableFlyingHit>()
.OrderByDescending(h => h.HitObject.StartTime)
.FirstOrDefault()?.HitObject.Type == hitType;
});
} }
private void addFlyingHit(HitType hitType) private void addFlyingHit(HitType hitType)
@ -42,6 +41,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
DrawableDrumRollTick h; DrawableDrumRollTick h;
DrawableRuleset.Playfield.Add(h = new DrawableDrumRollTick(tick) { JudgementType = hitType }); DrawableRuleset.Playfield.Add(h = new DrawableDrumRollTick(tick) { JudgementType = hitType });
h.OnLoadComplete += _ =>
((TaikoPlayfield)DrawableRuleset.Playfield).OnNewResult(h, new JudgementResult(tick, new TaikoDrumRollTickJudgement()) { Type = HitResult.Great }); ((TaikoPlayfield)DrawableRuleset.Playfield).OnNewResult(h, new JudgementResult(tick, new TaikoDrumRollTickJudgement()) { Type = HitResult.Great });
} }
} }

View File

@ -129,8 +129,12 @@ namespace osu.Game.Rulesets.Taiko.Tests
DrawableRuleset.Playfield.Add(h); DrawableRuleset.Playfield.Add(h);
h.OnLoadComplete += _ =>
{
((TaikoPlayfield)DrawableRuleset.Playfield).OnNewResult(h, new JudgementResult(hit, new TaikoJudgement()) { Type = hitResult }); ((TaikoPlayfield)DrawableRuleset.Playfield).OnNewResult(h, new JudgementResult(hit, new TaikoJudgement()) { Type = hitResult });
((TaikoPlayfield)DrawableRuleset.Playfield).OnNewResult(h.NestedHitObjects.Single(), new JudgementResult(hit.NestedHitObjects.Single(), new TaikoStrongJudgement()) { Type = HitResult.Great }); ((TaikoPlayfield)DrawableRuleset.Playfield).OnNewResult(h.NestedHitObjects.Single(),
new JudgementResult(hit.NestedHitObjects.Single(), new TaikoStrongJudgement()) { Type = HitResult.Great });
};
} }
private void addMissJudgement() private void addMissJudgement()