[test] update AdvanceTime() in unit tests to handle overflow (#8244)

This commit is contained in:
Abtin Keshavarzian
2022-10-06 08:54:27 -07:00
committed by GitHub
parent 10de4c4f13
commit 4eb64510bf
3 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -37,6 +37,7 @@
#include "common/arg_macros.hpp"
#include "common/array.hpp"
#include "common/instance.hpp"
#include "common/time.hpp"
#include "net/icmp6.hpp"
#include "net/nd6.hpp"
@@ -245,7 +246,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;