WITH_ENGINE_TEST_HELPER_BOARD_CALLBACK
This commit is contained in:
parent
9d2f9f0d35
commit
1b0d48d8c0
|
@ -77,6 +77,10 @@ void chDbgAssert(int c, char *msg, void *arg);
|
||||||
EngineTestHelper eth(x, std::unordered_map<SensorType, float>{}); \
|
EngineTestHelper eth(x, std::unordered_map<SensorType, float>{}); \
|
||||||
EXPAND_EngineTestHelper;
|
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)
|
#define CONFIG_PARAM(x) (x)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -137,15 +137,15 @@ TEST(etb, initializationDualThrottle) {
|
||||||
TEST(etb, initializationWastegate) {
|
TEST(etb, initializationWastegate) {
|
||||||
StrictMock<MockEtb> mocks[ETB_COUNT];
|
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++) {
|
for (int i = 0; i < ETB_COUNT; i++) {
|
||||||
engine->etbControllers[i] = &mocks[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 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));
|
EXPECT_CALL(mocks[0], init(ETB_Wastegate, _, &engineConfiguration->etbWastegatePid, Ne(nullptr), false)).WillOnce(Return(true));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue