Add negative duration check for unit tests

- The new`targetTimestamp` property causes the duration to be a negative value during the unit tests. Added an additional check to handle this case.
This commit is contained in:
Michael Thomas 2021-10-05 16:18:00 -04:00
parent 19540b3596
commit 0076d8c447
1 changed files with 1 additions and 1 deletions

View File

@ -103,7 +103,7 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
duration = nextFireDate - self.currentFireDate;
}
#endif
if (duration == 0) {
if (duration <= 0) {
duration = kSDDisplayLinkInterval;
}
return duration;