unit tests run in US with a loss of precision from NT fix #6450

This commit is contained in:
rusefi 2024-05-03 01:13:13 -04:00
parent 9b440f9045
commit b3f2faf0dd
1 changed files with 1 additions and 2 deletions

View File

@ -232,7 +232,6 @@ bool EventQueue::executeOne(efitick_t now) {
}
#if EFI_UNIT_TEST
// problem: we have a defect - tests are using US not NT so we are comparing apples to oranges here!
// efitick_t spinDuration = current->getMomentNt() - getTimeNowNt();
// if (spinDuration > 0) {
// throw std::runtime_error("Time Spin in unit test");
@ -242,9 +241,9 @@ bool EventQueue::executeOne(efitick_t now) {
// near future - spin wait for the event to happen and avoid the
// overhead of rescheduling the timer.
// yes, that's a busy wait but that's what we need here
// todo: problem: we have a defect - tests are using US not NT so we are comparing apples to oranges here!
while (current->getMomentNt() > getTimeNowNt()) {
#if EFI_UNIT_TEST
// todo: remove this hack see https://github.com/rusefi/rusefi/issues/6457
extern bool unitTestBusyWaitHack;
if (unitTestBusyWaitHack) {
break;