Compare commits

...

4 Commits

Author SHA1 Message Date
Matthew Kennedy 8d661ce22d unit test global cleanup 2024-04-26 08:54:20 -04:00
Matthew Kennedy 8cf48a177f unit test global cleanup 2024-04-26 08:17:41 -04:00
Matthew Kennedy 79b796954d unit test global cleanup 2024-04-26 08:17:30 -04:00
Matthew Kennedy 271b36cb72 haha these two functions do the same thing!? 2024-04-26 08:16:42 -04:00
7 changed files with 6 additions and 19 deletions

View File

@ -58,8 +58,6 @@ void chDbgAssert(int c, char *msg, void *arg);
#define VCS_VERSION "321"
#define RUS_EFI_VERSION_TAG "rusEfiVersion"
#define INLINE inline
#define EFI_ERROR_CODE 0xffffffff
#define CCM_OPTIONAL

View File

@ -375,16 +375,6 @@ void EngineTestHelper::setTriggerType(trigger_type_e trigger) {
applyTriggerWaveform();
}
void EngineTestHelper::executeUntil(int timeUs) {
scheduling_s *head;
while ((head = engine.executor.getHead()) != nullptr) {
if (head->momentX > timeUs) {
break;
}
setTimeAndInvokeEventsUs(head->momentX);
}
}
void setupSimpleTestEngineWithMafAndTT_ONE_trigger(EngineTestHelper *eth, injection_mode_e injectionMode) {
setCamOperationMode();
setupSimpleTestEngineWithMaf(eth, injectionMode, trigger_type_e::TT_HALF_MOON);

View File

@ -67,7 +67,6 @@ public:
void smartFireFall(float delayMs);
void moveTimeForwardAndInvokeEventsUs(int deltaTimeUs);
void setTimeAndInvokeEventsUs(int timeNowUs);
void executeUntil(int timeUs);
void moveTimeForwardAndInvokeEventsSec(int deltaTimeSeconds);
/**
* both Rise and Fall

View File

@ -8,7 +8,7 @@
#include "pch.h"
#include "global_execution_queue.h"
bool_t debugSignalExecutor = false;
bool debugSignalExecutor = false;
TestExecutor::~TestExecutor() {
// Flush the queue and reset all scheduling_s at the end of a test's execution

View File

@ -31,7 +31,7 @@ TEST(Actuators, AuxValves) {
eth.assertTriggerEvent("a3", 2, &engine->auxValves[1][1].open, (void*)&auxPlainPinTurnOn, 540);
// Execute the action it put on the regular scheduler
eth.executeUntil(999999);
eth.setTimeAndInvokeEventsUs(999999);
eth.assertTriggerEvent("a1", 0, &engine->auxValves[0][1].open, (void*)&auxPlainPinTurnOn, 360);
eth.assertTriggerEvent("a2", 1, &engine->auxValves[1][0].open, (void*)&auxPlainPinTurnOn, 180);

View File

@ -114,14 +114,14 @@ TEST(nissan, vq_vvt) {
ptrs);
}
eth.executeUntil(1473000);
eth.setTimeAndInvokeEventsUs(1473000);
ASSERT_EQ(167, round(Sensor::getOrZero(SensorType::Rpm)));
eth.executeUntil(1475000);
eth.setTimeAndInvokeEventsUs(1475000);
ASSERT_EQ(167, round(Sensor::getOrZero(SensorType::Rpm)));
TriggerCentral *tc = &engine->triggerCentral;
eth.executeUntil(3593000);
eth.setTimeAndInvokeEventsUs(3593000);
ASSERT_TRUE(tc->vvtState[0][0].getShaftSynchronized());
scheduling_s *head;

View File

@ -170,7 +170,7 @@ static void assertREqualsM(const char *msg, void *expected, void *actual) {
assertEqualsM(msg, (float)(uint64_t)expected, (float)(uint64_t)actual);
}
extern bool_t debugSignalExecutor;
extern bool debugSignalExecutor;
TEST(misc, testRpmCalculator) {
EngineTestHelper eth(engine_type_e::FORD_INLINE_6_1995);