Fix test failure under visual tests due to double firing

This commit is contained in:
Dean Herbert
2021-07-17 14:33:02 +09:00
parent db4d64effb
commit 23ed77f2c6

View File

@ -65,19 +65,16 @@ namespace osu.Game.Tests.Visual.UserInterface
AddStep($"set mistimed to {(allowMistimed ? "allowed" : "disallowed")}", () => beatContainer.AllowMistimedEventFiring = allowMistimed); AddStep($"set mistimed to {(allowMistimed ? "allowed" : "disallowed")}", () => beatContainer.AllowMistimedEventFiring = allowMistimed);
AddStep("bind event", () => AddStep("Set time before zero", () =>
{ {
beatContainer.NewBeat = (i, timingControlPoint, effectControlPoint, channelAmplitudes) => beatContainer.NewBeat = (i, timingControlPoint, effectControlPoint, channelAmplitudes) =>
{ {
lastActuationTime = gameplayClockContainer.CurrentTime; lastActuationTime = gameplayClockContainer.CurrentTime;
lastTimingPoint = timingControlPoint; lastTimingPoint = timingControlPoint;
lastBeatIndex = i; lastBeatIndex = i;
beatContainer.NewBeat = null;
}; };
});
AddStep("Set time before zero", () =>
{
lastBeatIndex = null;
gameplayClockContainer.Seek(-1000); gameplayClockContainer.Seek(-1000);
}); });
@ -99,19 +96,14 @@ namespace osu.Game.Tests.Visual.UserInterface
int? lastBeatIndex = null; int? lastBeatIndex = null;
double? lastBpm = null; double? lastBpm = null;
AddStep("bind event", () => AddStep("Set time before zero", () =>
{ {
beatContainer.NewBeat = (i, timingControlPoint, effectControlPoint, channelAmplitudes) => beatContainer.NewBeat = (i, timingControlPoint, effectControlPoint, channelAmplitudes) =>
{ {
lastBeatIndex = i; lastBeatIndex = i;
lastBpm = timingControlPoint.BPM; lastBpm = timingControlPoint.BPM;
}; };
});
AddStep("Set time before zero", () =>
{
lastBeatIndex = null;
lastBpm = null;
gameplayClockContainer.Seek(-1000); gameplayClockContainer.Seek(-1000);
}); });