Skip to content

Commit 5419d2f

Browse files
committed
Add test covering decoupled clock not drifting
1 parent 3fe1760 commit 5419d2f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

osu.Framework.Tests/Clocks/DecouplingFramedClockTest.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,23 @@ public void TestBackwardPlaybackOverZeroBoundary()
432432
}
433433
}
434434

435+
[Test]
436+
public void TestNoDecoupledDrift()
437+
{
438+
var stopwatch = new StopwatchClock();
439+
440+
decouplingClock.Start();
441+
stopwatch.Start();
442+
443+
decouplingClock.Seek(-100);
444+
stopwatch.Seek(-100);
445+
446+
while (decouplingClock.CurrentTime <= 0)
447+
decouplingClock.ProcessFrame();
448+
449+
Assert.That(decouplingClock.CurrentTime, Is.EqualTo(stopwatch.CurrentTime).Within(1));
450+
}
451+
435452
[Test]
436453
public void TestForwardPlaybackOverZeroBoundary()
437454
{

0 commit comments

Comments
 (0)