Skip to content

Commit

Permalink
fixed pausing test fail
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddio0141 committed Sep 1, 2023
1 parent 850748b commit 02bc9ab
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ namespace UniTAS.Patcher.Models.DependencyInjection;
public enum RegisterPriority
{
// the higher you place it, the lower the value, the earlier it gets processed in the registering
FirstUpdateSkipOnRestart,
TimeEnv,
MovieRunner,
RuntimeTestProcessor,
Expand Down
3 changes: 2 additions & 1 deletion UniTAS/Patcher/Models/EventSubscribers/CallbackPriority.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ public enum CallbackPriority
{
// the higher you place it, the lower the value, the earlier it gets invoked
FirstUpdateSkipOnRestart,
Default
Default,
FrameAdvancingTest
}
6 changes: 4 additions & 2 deletions UniTAS/Patcher/RuntimeTests/FrameAdvancingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using UniTAS.Patcher.Interfaces.Coroutine;
using UniTAS.Patcher.Interfaces.DependencyInjection;
using UniTAS.Patcher.Interfaces.RuntimeTest;
using UniTAS.Patcher.Models.EventSubscribers;
using UniTAS.Patcher.Services;
using UniTAS.Patcher.Services.EventSubscribers;
using UniTAS.Patcher.Services.FrameAdvancing;
Expand Down Expand Up @@ -81,7 +82,8 @@ public IEnumerable<CoroutineWait> FrameAdvanceFirstPause()
// this should pause it instantly
_frameAdvancing.FrameAdvance(2, FrameAdvanceMode.Update);

_updateEvents.OnUpdateActual += UpdateCounter;
_updateEvents.AddPriorityCallback(CallbackUpdate.UpdateActual, UpdateCounter,
CallbackPriority.FrameAdvancingTest);
_updateEvents.OnFixedUpdateActual += FixedUpdateCounter;

yield return FrameAdvanceWaits;
Expand Down Expand Up @@ -273,7 +275,7 @@ public IEnumerable<CoroutineWait> FrameAdvanceUpdateAndFixedUpdate()
yield return new WaitForCoroutine(CleanUp());
}

private static WaitForCoroutine FrameAdvanceWaits { get; } = new(FrameAdvanceWaitsCoroutine());
private static WaitForCoroutine FrameAdvanceWaits => new(FrameAdvanceWaitsCoroutine());

private static IEnumerable<CoroutineWait> FrameAdvanceWaitsCoroutine()
{
Expand Down

0 comments on commit 02bc9ab

Please sign in to comment.