mirror of
https://github.com/espressif/openthread.git
synced 2026-08-10 12:47:47 +00:00
[test] update AdvanceTime() in unit tests to handle overflow (#8244)
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
#include "common/array.hpp"
|
||||
#include "common/instance.hpp"
|
||||
#include "common/string.hpp"
|
||||
#include "common/time.hpp"
|
||||
|
||||
#if OPENTHREAD_CONFIG_SRP_SERVER_ENABLE && OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE && \
|
||||
!OPENTHREAD_CONFIG_TIME_SYNC_ENABLE && !OPENTHREAD_PLATFORM_POSIX
|
||||
@@ -179,7 +180,7 @@ void AdvanceTime(uint32_t aDuration)
|
||||
|
||||
Log("AdvanceTime for %u.%03u", aDuration / 1000, aDuration % 1000);
|
||||
|
||||
while (sAlarmTime <= time)
|
||||
while (TimeMilli(sAlarmTime) <= TimeMilli(time))
|
||||
{
|
||||
ProcessRadioTxAndTasklets();
|
||||
sNow = sAlarmTime;
|
||||
|
||||
Reference in New Issue
Block a user