tests: moving away from global timeNowUs
This commit is contained in:
parent
beb84cfff9
commit
ba3ebfb477
|
@ -7,8 +7,6 @@
|
|||
#include "engine_math.h"
|
||||
#include "engine_test_helper.h"
|
||||
|
||||
extern int timeNowUs;
|
||||
|
||||
TEST(sensors, testFasterEngineSpinningUp) {
|
||||
printf("*************************************************** testFasterEngineSpinningUp\r\n");
|
||||
|
||||
|
@ -81,7 +79,7 @@ TEST(sensors, testFasterEngineSpinningUp) {
|
|||
eth.fireFall(60);
|
||||
|
||||
eth.clearQueue();
|
||||
timeStartUs = timeNowUs;
|
||||
timeStartUs = eth.getTimeNowUs();
|
||||
eth.fireTriggerEventsWithDuration(60);
|
||||
|
||||
// check if the mode is now changed to 'running' at higher RPM
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
#include "event_queue.h"
|
||||
#include "tps.h"
|
||||
|
||||
extern int timeNowUs;
|
||||
|
||||
TEST(fuelCut, coasting) {
|
||||
printf("*************************************************** testCoastingFuelCut\r\n");
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "spark_logic.h"
|
||||
#include "trigger_universal.h"
|
||||
|
||||
extern int timeNowUs;
|
||||
extern float mockMapValue;
|
||||
extern float testMafValue;
|
||||
extern WarningCodeState unitTestWarningCodeState;
|
||||
|
@ -1032,11 +1031,11 @@ TEST(big, testFuelSchedulerBug299smallAndLarge) {
|
|||
// assertInjectorDownEvent("L04@8", 8, MS2US(50.0), 0);
|
||||
|
||||
|
||||
engine->executor.executeAll(timeNowUs + 1);
|
||||
engine->executor.executeAll(eth.getTimeNowUs() + 1);
|
||||
// injector goes high...
|
||||
ASSERT_FALSE(enginePins.injectors[0].currentLogicValue) << "injector@1";
|
||||
|
||||
engine->executor.executeAll(timeNowUs + MS2US(17.5) + 1);
|
||||
engine->executor.executeAll(eth.getTimeNowUs() + MS2US(17.5) + 1);
|
||||
// injector does not go low too soon, that's a feature :)
|
||||
ASSERT_TRUE(enginePins.injectors[0].currentLogicValue) << "injector@2";
|
||||
|
||||
|
@ -1052,7 +1051,7 @@ TEST(big, testFuelSchedulerBug299smallAndLarge) {
|
|||
//todo assertInjectorDownEvent("L015@5", 5, MS2US(30), 0);
|
||||
|
||||
|
||||
engine->executor.executeAll(timeNowUs + MS2US(10) + 1);
|
||||
engine->executor.executeAll(eth.getTimeNowUs() + MS2US(10) + 1);
|
||||
// end of combined injection
|
||||
ASSERT_FALSE(enginePins.injectors[0].currentLogicValue) << "injector@3";
|
||||
|
||||
|
|
Loading…
Reference in New Issue