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

only: first skeleton from the closet!
This commit is contained in:
rusefi 2024-05-02 23:32:25 -04:00
parent 545939d7a9
commit dffc579acf
2 changed files with 6 additions and 2 deletions

View File

@ -49,6 +49,10 @@ scheduling_s* TestExecutor::getForUnitTest(int index) {
}
void TestExecutor::scheduleByTimestamp(const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action) {
if (timeUs < 0) {
throw std::runtime_error("Negative timeUs not expected.");
}
if (debugSignalExecutor) {
printf("scheduleByTime %d\r\n", timeUs);
}

View File

@ -110,7 +110,7 @@ TEST(nissan, vq_vvt) {
/* timeScale */ vvtTimeScale,
cyclesCount / 6, true,
/* vvtBankIndex */1,
/* vvtOffset */ testVvtOffset + NISSAN_VQ_CAM_OFFSET,
/* vvtOffset, making it positive */ 720 + testVvtOffset + NISSAN_VQ_CAM_OFFSET,
ptrs);
}
@ -136,7 +136,7 @@ TEST(nissan, vq_vvt) {
ASSERT_NEAR(34, tc->vvtPosition[0][0], EPS2D) << "queueIndex=" << queueIndex;
queueIndex++;
}
ASSERT_TRUE(queueIndex == 422) << "Total queueIndex=" << queueIndex;
ASSERT_EQ(queueIndex, 432) << "Total queueIndex=" << queueIndex;
ASSERT_TRUE(tc->vvtState[1][0].getShaftSynchronized());