2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file engine_test_helper.h
|
|
|
|
*
|
|
|
|
* @date Jun 26, 2014
|
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2014
|
|
|
|
*/
|
|
|
|
#ifndef ENGINE_TEST_HELPER_H_
|
|
|
|
#define ENGINE_TEST_HELPER_H_
|
|
|
|
|
|
|
|
#include "engine.h"
|
|
|
|
#include "trigger_central.h"
|
|
|
|
#include "rpm_calculator.h"
|
2016-08-26 17:03:06 -07:00
|
|
|
#include "main_trigger_callback.h"
|
2018-03-04 20:08:32 -08:00
|
|
|
#include "unit_test_framework.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2018-07-28 12:31:01 -07:00
|
|
|
/**
|
|
|
|
* Mock engine with trigger signal simulation infrastructure
|
|
|
|
*/
|
2015-07-10 06:01:56 -07:00
|
|
|
class EngineTestHelper {
|
|
|
|
public:
|
|
|
|
EngineTestHelper(engine_type_e engineType);
|
2016-08-26 17:03:06 -07:00
|
|
|
void applyTriggerShape();
|
2018-07-28 16:51:41 -07:00
|
|
|
void fireRise(int delayMs);
|
|
|
|
void fireFall(int delayMs);
|
|
|
|
|
2016-08-27 16:02:43 -07:00
|
|
|
void firePrimaryTriggerRise();
|
|
|
|
void firePrimaryTriggerFall();
|
2016-01-24 22:02:55 -08:00
|
|
|
void fireTriggerEvents(int count);
|
2018-07-28 16:51:41 -07:00
|
|
|
void fireTriggerEventsWithDuration(int delayMs);
|
|
|
|
void fireTriggerEvents2(int count, int delayMs);
|
2018-03-04 13:38:01 -08:00
|
|
|
void clearQueue();
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
Engine engine;
|
2018-07-28 12:31:01 -07:00
|
|
|
persistent_config_s persistentConfig;
|
2015-07-10 06:01:56 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* ENGINE_TEST_HELPER_H_ */
|