Fix unit tests following #939
This commit is contained in:
parent
8e4b840325
commit
b30fde5685
|
@ -287,8 +287,6 @@ uint16_t correctionAccel(void)
|
||||||
int16_t accelValue = 100;
|
int16_t accelValue = 100;
|
||||||
int16_t MAP_change = 0;
|
int16_t MAP_change = 0;
|
||||||
int16_t TPS_change = 0;
|
int16_t TPS_change = 0;
|
||||||
int16_t MAP_rateOfChange = 0;
|
|
||||||
int16_t TPS_rateOfChange = 0;
|
|
||||||
|
|
||||||
if(configPage2.aeMode == AE_MODE_MAP)
|
if(configPage2.aeMode == AE_MODE_MAP)
|
||||||
{
|
{
|
||||||
|
|
|
@ -95,7 +95,6 @@ byte checkBoostLimit(void)
|
||||||
byte checkOilPressureLimit(void)
|
byte checkOilPressureLimit(void)
|
||||||
{
|
{
|
||||||
byte oilProtectActive = 0;
|
byte oilProtectActive = 0;
|
||||||
static constexpr char X100_MULTIPLIER = 100;
|
|
||||||
bool alreadyActive = BIT_CHECK(currentStatus.engineProtectStatus, ENGINE_PROTECT_BIT_OIL);
|
bool alreadyActive = BIT_CHECK(currentStatus.engineProtectStatus, ENGINE_PROTECT_BIT_OIL);
|
||||||
BIT_CLEAR(currentStatus.engineProtectStatus, ENGINE_PROTECT_BIT_OIL); //Will be set true below if required
|
BIT_CLEAR(currentStatus.engineProtectStatus, ENGINE_PROTECT_BIT_OIL); //Will be set true below if required
|
||||||
|
|
||||||
|
|
|
@ -229,7 +229,7 @@ void test_corrections_TAE_no_rpm_taper()
|
||||||
|
|
||||||
uint16_t accelValue = correctionAccel(); //Run the AE calcs
|
uint16_t accelValue = correctionAccel(); //Run the AE calcs
|
||||||
|
|
||||||
TEST_ASSERT_EQUAL(75, currentStatus.tpsDOT); //DOT is 750%/s (25 * 30), value divided by 10;
|
TEST_ASSERT_EQUAL(750, currentStatus.tpsDOT); //DOT is 750%/s (25 * 30)
|
||||||
TEST_ASSERT_EQUAL((100+132), accelValue);
|
TEST_ASSERT_EQUAL((100+132), accelValue);
|
||||||
TEST_ASSERT_TRUE(BIT_CHECK(currentStatus.engine, BIT_ENGINE_ACC)); //Confirm AE is flagged on
|
TEST_ASSERT_TRUE(BIT_CHECK(currentStatus.engine, BIT_ENGINE_ACC)); //Confirm AE is flagged on
|
||||||
}
|
}
|
||||||
|
@ -246,7 +246,7 @@ void test_corrections_TAE_50pc_rpm_taper()
|
||||||
|
|
||||||
uint16_t accelValue = correctionAccel(); //Run the AE calcs
|
uint16_t accelValue = correctionAccel(); //Run the AE calcs
|
||||||
|
|
||||||
TEST_ASSERT_EQUAL(75, currentStatus.tpsDOT); //DOT is 750%/s (25 * 30), value divided by 10;
|
TEST_ASSERT_EQUAL(750, currentStatus.tpsDOT); //DOT is 750%/s (25 * 30)
|
||||||
TEST_ASSERT_EQUAL((100+66), accelValue);
|
TEST_ASSERT_EQUAL((100+66), accelValue);
|
||||||
TEST_ASSERT_TRUE(BIT_CHECK(currentStatus.engine, BIT_ENGINE_ACC)); //Confirm AE is flagged on
|
TEST_ASSERT_TRUE(BIT_CHECK(currentStatus.engine, BIT_ENGINE_ACC)); //Confirm AE is flagged on
|
||||||
}
|
}
|
||||||
|
@ -263,7 +263,7 @@ void test_corrections_TAE_110pc_rpm_taper()
|
||||||
|
|
||||||
uint16_t accelValue = correctionAccel(); //Run the AE calcs
|
uint16_t accelValue = correctionAccel(); //Run the AE calcs
|
||||||
|
|
||||||
TEST_ASSERT_EQUAL(75, currentStatus.tpsDOT); //DOT is 750%/s (25 * 30), value divided by 10;
|
TEST_ASSERT_EQUAL(750, currentStatus.tpsDOT); //DOT is 750%/s (25 * 30)
|
||||||
TEST_ASSERT_EQUAL(100, accelValue); //Should be no AE as we're above the RPM taper end point
|
TEST_ASSERT_EQUAL(100, accelValue); //Should be no AE as we're above the RPM taper end point
|
||||||
TEST_ASSERT_TRUE(BIT_CHECK(currentStatus.engine, BIT_ENGINE_ACC)); //Confirm AE is flagged on
|
TEST_ASSERT_TRUE(BIT_CHECK(currentStatus.engine, BIT_ENGINE_ACC)); //Confirm AE is flagged on
|
||||||
}
|
}
|
||||||
|
@ -281,7 +281,7 @@ void test_corrections_TAE_under_threshold()
|
||||||
|
|
||||||
uint16_t accelValue = correctionAccel(); //Run the AE calcs
|
uint16_t accelValue = correctionAccel(); //Run the AE calcs
|
||||||
|
|
||||||
TEST_ASSERT_EQUAL(9, currentStatus.tpsDOT); //DOT is 90%/s (3% * 30), value divided by 10;
|
TEST_ASSERT_EQUAL(90, currentStatus.tpsDOT); //DOT is 90%/s (3% * 30)
|
||||||
TEST_ASSERT_EQUAL(100, accelValue); //Should be no AE as we're above the RPM taper end point
|
TEST_ASSERT_EQUAL(100, accelValue); //Should be no AE as we're above the RPM taper end point
|
||||||
TEST_ASSERT_FALSE(BIT_CHECK(currentStatus.engine, BIT_ENGINE_ACC)); //Confirm AE is flagged off
|
TEST_ASSERT_FALSE(BIT_CHECK(currentStatus.engine, BIT_ENGINE_ACC)); //Confirm AE is flagged off
|
||||||
}
|
}
|
||||||
|
@ -305,7 +305,7 @@ void test_corrections_TAE_50pc_warmup_taper()
|
||||||
|
|
||||||
uint16_t accelValue = correctionAccel(); //Run the AE calcs
|
uint16_t accelValue = correctionAccel(); //Run the AE calcs
|
||||||
|
|
||||||
TEST_ASSERT_EQUAL(75, currentStatus.tpsDOT); //DOT is 750%/s (25 * 30), value divided by 10;
|
TEST_ASSERT_EQUAL(750, currentStatus.tpsDOT); //DOT is 750%/s (25 * 30)
|
||||||
TEST_ASSERT_EQUAL((100+165), accelValue); //Total AE should be 132 + (50% * 50%) = 132 * 1.25 = 165
|
TEST_ASSERT_EQUAL((100+165), accelValue); //Total AE should be 132 + (50% * 50%) = 132 * 1.25 = 165
|
||||||
TEST_ASSERT_TRUE(BIT_CHECK(currentStatus.engine, BIT_ENGINE_ACC)); //Confirm AE is flagged on
|
TEST_ASSERT_TRUE(BIT_CHECK(currentStatus.engine, BIT_ENGINE_ACC)); //Confirm AE is flagged on
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue