File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
osu.Framework.Tests/Clocks Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -250,6 +250,28 @@ public void TestInterpolationAfterSourceStoppedThenSeeked()
250250 Assert . That ( interpolating . ElapsedFrameTime , Is . EqualTo ( 0 ) . Within ( 100 ) ) ;
251251 }
252252
253+ [ TestCase ( 0 ) ]
254+ [ TestCase ( 1 ) ]
255+ [ TestCase ( 10 ) ]
256+ [ TestCase ( 50 ) ]
257+ public void TestNoInterpolationDrift ( int updateRate )
258+ {
259+ var stopwatch = new StopwatchClock ( ) ;
260+
261+ interpolating . ChangeSource ( stopwatch ) ;
262+
263+ source . Start ( ) ;
264+ stopwatch . Start ( ) ;
265+
266+ while ( interpolating . CurrentTime <= 1000 )
267+ {
268+ interpolating . ProcessFrame ( ) ;
269+ Assert . That ( interpolating . CurrentTime , Is . EqualTo ( stopwatch . CurrentTime ) . Within ( 1 ) ) ;
270+
271+ Thread . Sleep ( updateRate ) ;
272+ }
273+ }
274+
253275 [ Test ]
254276 public void InterpolationStaysWithinBounds ( )
255277 {
You can’t perform that action at this time.
0 commit comments