WITH_ENGINE_TEST_HELPER_BOARD_CALLBACK

This commit is contained in:
Andrey 2021-11-08 12:27:02 -05:00
parent 9d2f9f0d35
commit 1b0d48d8c0
2 changed files with 8 additions and 4 deletions

View File

@ -77,6 +77,10 @@ void chDbgAssert(int c, char *msg, void *arg);
EngineTestHelper eth(x, std::unordered_map<SensorType, float>{}); \
EXPAND_EngineTestHelper;
#define WITH_ENGINE_TEST_HELPER_BOARD_CALLBACK(x, callback) \
EngineTestHelper eth(x, callback, std::unordered_map<SensorType, float>{}); \
EXPAND_EngineTestHelper;
#define CONFIG_PARAM(x) (x)
#ifdef __cplusplus

View File

@ -137,15 +137,15 @@ TEST(etb, initializationDualThrottle) {
TEST(etb, initializationWastegate) {
StrictMock<MockEtb> mocks[ETB_COUNT];
WITH_ENGINE_TEST_HELPER(TEST_ENGINE);
WITH_ENGINE_TEST_HELPER_BOARD_CALLBACK(TEST_ENGINE, [](engine_configuration_s* engineConfiguration) {
engineConfiguration->etbFunctions[0] = ETB_Wastegate;
engineConfiguration->etbFunctions[1] = ETB_None;
});
for (int i = 0; i < ETB_COUNT; i++) {
engine->etbControllers[i] = &mocks[i];
}
engineConfiguration->etbFunctions[0] = ETB_Wastegate;
engineConfiguration->etbFunctions[1] = ETB_None;
// Expect mock0 to be init as throttle 1, and PID wastegate params
EXPECT_CALL(mocks[0], init(ETB_Wastegate, _, &engineConfiguration->etbWastegatePid, Ne(nullptr), false)).WillOnce(Return(true));