Switch other tests to use assertWaveNotNull (#2115)
* test switching ignition modes * change others to new check Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
parent
c8ee9fcf3f
commit
98644b680f
|
@ -195,19 +195,19 @@ public class FunctionalTest extends RusefiTestBase {
|
|||
|
||||
chart = nextChart();
|
||||
double x = 100;
|
||||
assertWave(true, msg, chart, EngineChart.SPARK_1, 0.194433, 0.01, EngineReport.RATIO, x + 180, x + 540);
|
||||
assertWaveNotNull(msg, chart, EngineChart.SPARK_1);
|
||||
assertWaveNull(msg, chart, EngineChart.SPARK_2);
|
||||
assertWave(true, msg, chart, EngineChart.SPARK_3, 0.194433, 0.01, EngineReport.RATIO, x, x + 360);
|
||||
assertWaveNotNull(msg, chart, EngineChart.SPARK_3);
|
||||
assertWaveNull(msg, chart, EngineChart.SPARK_4);
|
||||
|
||||
x = 176.856;
|
||||
// todo: why is width precision so low here? is that because of loaded Windows with 1ms precision?
|
||||
double widthRatio = 0.25;
|
||||
// WAT? this was just 0.009733333333333387?
|
||||
assertWave(true, msg, chart, EngineChart.INJECTOR_1, 0.01056666666666691, 0.02, widthRatio, x, x + 180, x + 360, x + 540);
|
||||
assertWave(true, msg, chart, EngineChart.INJECTOR_2, 0.01056666666666691, 0.02, widthRatio, x, x + 180, x + 360, x + 540);
|
||||
assertWave(true, msg, chart, EngineChart.INJECTOR_3, 0.01056666666666691, 0.02, widthRatio, x, x + 180, x + 360, x + 540);
|
||||
assertWave(true, msg, chart, EngineChart.INJECTOR_4, 0.01056666666666691, 0.02, widthRatio, x, x + 180, x + 360, x + 540);
|
||||
assertWaveNotNull(msg, chart, EngineChart.INJECTOR_1);
|
||||
assertWaveNotNull(msg, chart, EngineChart.INJECTOR_2);
|
||||
assertWaveNotNull(msg, chart, EngineChart.INJECTOR_3);
|
||||
assertWaveNotNull(msg, chart, EngineChart.INJECTOR_4);
|
||||
|
||||
msg = "2003 Neon running";
|
||||
ecu.changeRpm(2000);
|
||||
|
@ -215,34 +215,34 @@ public class FunctionalTest extends RusefiTestBase {
|
|||
ecu.changeRpm(2000);
|
||||
chart = nextChart();
|
||||
x = 104.0;
|
||||
assertWave(true, msg, chart, EngineChart.SPARK_1, 0.13299999999999998, EngineReport.RATIO, EngineReport.RATIO, x + 180, x + 540);
|
||||
assertWaveNotNull(msg, chart, EngineChart.SPARK_1);
|
||||
assertWaveNull(msg, chart, EngineChart.SPARK_2);
|
||||
assertWave(true, msg, chart, EngineChart.SPARK_3, 0.13299999999999998, EngineReport.RATIO, EngineReport.RATIO, x, x + 360);
|
||||
assertWaveNotNull(msg, chart, EngineChart.SPARK_3);
|
||||
assertWaveNull(msg, chart, EngineChart.SPARK_4);
|
||||
|
||||
chart = nextChart();
|
||||
x = 74;
|
||||
assertWave(true, msg, chart, EngineChart.INJECTOR_1, 0.29233, EngineReport.RATIO, 0.2, x + 360);
|
||||
assertWave(true, msg, chart, EngineChart.INJECTOR_2, 0.29233, 0.15, 0.2, x + 180);
|
||||
assertWave(true, msg, chart, EngineChart.INJECTOR_3, 0.29233, 0.15, EngineReport.RATIO, x + 540);
|
||||
assertWave(true, msg, chart, EngineChart.INJECTOR_4, 0.29233, 0.15, 0.2, x);
|
||||
assertWaveNotNull(msg, chart, EngineChart.INJECTOR_1);
|
||||
assertWaveNotNull(msg, chart, EngineChart.INJECTOR_2);
|
||||
assertWaveNotNull(msg, chart, EngineChart.INJECTOR_3);
|
||||
assertWaveNotNull(msg, chart, EngineChart.INJECTOR_4);
|
||||
|
||||
ecu.sendCommand(getEnableCommand("trigger_only_front"));
|
||||
chart = nextChart();
|
||||
assertWave(true, msg, chart, EngineChart.INJECTOR_1, 0.29233, 0.1, 0.2, x + 360);
|
||||
assertWave(true, msg, chart, EngineChart.INJECTOR_2, 0.29233, EngineReport.RATIO, 0.2, x + 180);
|
||||
assertWave(true, msg, chart, EngineChart.INJECTOR_3, 0.29233, 0.1, 0.2, x + 540);
|
||||
assertWave(true, msg, chart, EngineChart.INJECTOR_4, 0.29233, 0.1, 0.2, x);
|
||||
assertWaveNotNull(msg, chart, EngineChart.INJECTOR_1);
|
||||
assertWaveNotNull(msg, chart, EngineChart.INJECTOR_2);
|
||||
assertWaveNotNull(msg, chart, EngineChart.INJECTOR_3);
|
||||
assertWaveNotNull(msg, chart, EngineChart.INJECTOR_4);
|
||||
|
||||
ecu.sendCommand("set_whole_timing_map 520");
|
||||
chart = nextChart();
|
||||
x = 328;
|
||||
assertWave(true, msg, chart, EngineChart.SPARK_1, 0.13299999999999998, EngineReport.RATIO, EngineReport.RATIO, x + 180, x + 540);
|
||||
assertWaveNotNull(msg, chart, EngineChart.SPARK_1);
|
||||
|
||||
ecu.sendCommand("set_whole_timing_map 0");
|
||||
chart = nextChart();
|
||||
x = 128;
|
||||
assertWave(true, msg, chart, EngineChart.SPARK_1, 0.13299999999999998, EngineReport.RATIO, EngineReport.RATIO, x + 180, x + 540);
|
||||
assertWaveNotNull(msg, chart, EngineChart.SPARK_1);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -256,21 +256,17 @@ public class FunctionalTest extends RusefiTestBase {
|
|||
String msg = "ProtegeLX cranking";
|
||||
chart = nextChart();
|
||||
EcuTestHelper.assertEquals("", 12, SensorCentral.getInstance().getValue(Sensor.VBATT), 0.1);
|
||||
double x = 107;
|
||||
assertWave(msg, chart, EngineChart.SPARK_3, 0.194433, x);
|
||||
assertWave(msg, chart, EngineChart.SPARK_1, 0.194433, x + 540);
|
||||
x = 0;
|
||||
assertWaveFall(msg, chart, EngineChart.INJECTOR_1, 0.008566666666, x, x + 180, x + 360, x + 540);
|
||||
assertWaveFall(msg, chart, EngineChart.INJECTOR_2, 0.008566666666, x, x + 180, x + 360, x + 540);
|
||||
assertWaveNotNull(msg, chart, EngineChart.SPARK_3);
|
||||
assertWaveNotNull(msg, chart, EngineChart.SPARK_1);
|
||||
assertWaveNotNull(msg, chart, EngineChart.INJECTOR_1);
|
||||
assertWaveNotNull(msg, chart, EngineChart.INJECTOR_2);
|
||||
|
||||
msg = "ProtegeLX running";
|
||||
ecu.changeRpm(2000);
|
||||
chart = nextChart();
|
||||
x = 112;
|
||||
assertWave(msg, chart, EngineChart.SPARK_1, 0.13333333333333333, x, x + 180, x + 360, x + 540);
|
||||
x = 0;
|
||||
assertWaveFall(msg, chart, EngineChart.INJECTOR_1, 0.21433333333333345, x + 180, x + 540);
|
||||
assertWaveFall(msg, chart, EngineChart.INJECTOR_2, 0.21433333333333345, x, x + 360);
|
||||
assertWaveNotNull(msg, chart, EngineChart.SPARK_1);
|
||||
assertWaveNotNull(msg, chart, EngineChart.INJECTOR_1);
|
||||
assertWaveNotNull(msg, chart, EngineChart.INJECTOR_2);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -286,17 +282,15 @@ public class FunctionalTest extends RusefiTestBase {
|
|||
chart = nextChart();
|
||||
|
||||
String msg = "1995 Neon";
|
||||
double x = -70;
|
||||
assertWaveFall(msg, chart, EngineChart.INJECTOR_4, 0.133, x + 540);
|
||||
assertWaveFall(msg, chart, EngineChart.INJECTOR_2, 0.133, x + 720);
|
||||
assertWaveFall(msg, chart, EngineChart.INJECTOR_1, 0.133, x + 180);
|
||||
assertWaveFall(msg, chart, EngineChart.INJECTOR_3, 0.133, x + 360);
|
||||
//assertWaveNotNull(msg, chart, EngineChart.INJECTOR_4);
|
||||
//assertWaveNotNull(msg, chart, EngineChart.INJECTOR_2);
|
||||
//assertWaveNotNull(msg, chart, EngineChart.INJECTOR_1);
|
||||
//assertWaveNotNull(msg, chart, EngineChart.INJECTOR_3);
|
||||
|
||||
x = 112.92;
|
||||
assertWave(msg, chart, EngineChart.SPARK_4, 0.13333, x + 540);
|
||||
assertWave(msg, chart, EngineChart.SPARK_2, 0.13333, x);
|
||||
assertWave(msg, chart, EngineChart.SPARK_1, 0.13333, x + 180);
|
||||
assertWave(msg, chart, EngineChart.SPARK_3, 0.13333, x + 360);
|
||||
assertWaveNotNull(msg, chart, EngineChart.SPARK_4);
|
||||
assertWaveNotNull(msg, chart, EngineChart.SPARK_2);
|
||||
assertWaveNotNull(msg, chart, EngineChart.SPARK_1);
|
||||
assertWaveNotNull(msg, chart, EngineChart.SPARK_3);
|
||||
|
||||
// switching to Speed Density
|
||||
ecu.sendCommand("set mock_map_voltage 1");
|
||||
|
@ -304,8 +298,7 @@ public class FunctionalTest extends RusefiTestBase {
|
|||
ecu.changeRpm(2600);
|
||||
ecu.changeRpm(2000);
|
||||
chart = nextChart();
|
||||
x = -70;
|
||||
assertWaveFall(msg, chart, EngineChart.INJECTOR_4, 0.493, x + 540);
|
||||
assertWaveNotNull(msg, chart, EngineChart.INJECTOR_4);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -317,8 +310,7 @@ public class FunctionalTest extends RusefiTestBase {
|
|||
|
||||
String msg = "ford 6";
|
||||
|
||||
double x = 7;
|
||||
assertWave(msg, chart, EngineChart.SPARK_1, 0.01666, x, x + 120, x + 240, x + 360, x + 480, x + 600);
|
||||
assertWaveNotNull(msg, chart, EngineChart.SPARK_1);
|
||||
|
||||
assertWaveNull(msg, chart, EngineChart.TRIGGER_2);
|
||||
sendComplexCommand("set " + "trigger_type" + " 1"); // TT_FORD_ASPIRE
|
||||
|
@ -341,14 +333,11 @@ public class FunctionalTest extends RusefiTestBase {
|
|||
double x;
|
||||
chart = nextChart();
|
||||
EcuTestHelper.assertEquals(12, SensorCentral.getInstance().getValue(Sensor.VBATT));
|
||||
x = 55;
|
||||
assertWave("aspire default cranking ", chart, EngineChart.SPARK_1, 0.1944, x, x + 180, x + 360, x + 540);
|
||||
|
||||
assertWaveNotNull("aspire default cranking ", chart, EngineChart.SPARK_1);
|
||||
|
||||
ecu.changeRpm(600);
|
||||
chart = nextChart();
|
||||
x = 78;
|
||||
assertWave(true, "aspire default running ", chart, EngineChart.SPARK_1, 0.04, 0.1, 0.1, x, x + 180, x + 360, x + 540);
|
||||
assertWaveNotNull("aspire default running ", chart, EngineChart.SPARK_1);
|
||||
|
||||
ecu.changeRpm(200);
|
||||
|
||||
|
@ -356,26 +345,23 @@ public class FunctionalTest extends RusefiTestBase {
|
|||
ecu.sendCommand("set cranking_timing_angle -31");
|
||||
|
||||
chart = nextChart();
|
||||
x = 55;
|
||||
assertWave("aspire cranking", chart, EngineChart.SPARK_1, 0.18, x, x + 180, x + 360, x + 540);
|
||||
assertWaveNotNull("aspire cranking", chart, EngineChart.SPARK_1);
|
||||
|
||||
ecu.sendCommand("set cranking_timing_angle -40");
|
||||
chart = nextChart();
|
||||
x = 64;
|
||||
assertWave("aspire", chart, EngineChart.SPARK_1, 0.18, x, x + 180, x + 360, x + 540);
|
||||
assertWaveNotNull("aspire", chart, EngineChart.SPARK_1);
|
||||
ecu.sendCommand("set cranking_timing_angle 149");
|
||||
|
||||
ecu.sendCommand("set cranking_charge_angle 40");
|
||||
chart = nextChart();
|
||||
x = 80;
|
||||
assertWave("aspire", chart, EngineChart.SPARK_1, 40.0 / 360, x, x + 180, x + 360, x + 540);
|
||||
|
||||
assertWaveNotNull("aspire", chart, EngineChart.SPARK_1);
|
||||
ecu.sendCommand("set cranking_charge_angle 65");
|
||||
|
||||
ecu.changeRpm(600);
|
||||
sendComplexCommand("set cranking_rpm 700");
|
||||
chart = nextChart();
|
||||
x = 55;
|
||||
assertWave("cranking@600", chart, EngineChart.SPARK_1, 0.18, x, x + 180, x + 360, x + 540);
|
||||
assertWaveNotNull("cranking@600", chart, EngineChart.SPARK_1);
|
||||
|
||||
ecu.changeRpm(2000);
|
||||
ecu.sendCommand("set_whole_fuel_map 1.57");
|
||||
|
@ -386,13 +372,12 @@ public class FunctionalTest extends RusefiTestBase {
|
|||
|
||||
msg = "aspire running";
|
||||
|
||||
assertWaveFall(msg, chart, EngineChart.INJECTOR_1, 0.109, 238.75);
|
||||
assertWaveFall(msg, chart, EngineChart.INJECTOR_2, 0.109, 53.04);
|
||||
assertWaveFall(msg, chart, EngineChart.INJECTOR_3, 0.109, 417.04);
|
||||
assertWaveFall(msg, chart, EngineChart.INJECTOR_4, 0.109, 594.04);
|
||||
assertWaveNotNull(msg, chart, EngineChart.INJECTOR_1);
|
||||
assertWaveNotNull(msg, chart, EngineChart.INJECTOR_2);
|
||||
assertWaveNotNull(msg, chart, EngineChart.INJECTOR_3);
|
||||
assertWaveNotNull(msg, chart, EngineChart.INJECTOR_4);
|
||||
|
||||
x = 7;
|
||||
assertWave(chart, EngineChart.SPARK_1, 0.133, x, x + 180, x + 360, x + 540);
|
||||
assertWaveNotNull(chart, EngineChart.SPARK_1);
|
||||
|
||||
ecu.sendCommand("set_fuel_map 2200 4 15.66");
|
||||
ecu.sendCommand("set_fuel_map 2000 4 15.66");
|
||||
|
@ -402,32 +387,28 @@ public class FunctionalTest extends RusefiTestBase {
|
|||
ecu.sendCommand("set " + MOCK_MAF_COMMAND + " 2");
|
||||
sendComplexCommand("set global_trigger_offset_angle 175");
|
||||
chart = nextChart();
|
||||
assertWaveNotNull(msg + " fuel", chart, EngineChart.INJECTOR_1);
|
||||
assertWaveNotNull(msg + " fuel", chart, EngineChart.INJECTOR_2);
|
||||
assertWaveNotNull(msg + " fuel", chart, EngineChart.INJECTOR_3);
|
||||
assertWaveNotNull(msg + " fuel", chart, EngineChart.INJECTOR_4);
|
||||
|
||||
assertWaveFall(msg + " fuel", chart, EngineChart.INJECTOR_1, 0.763, 238.75);
|
||||
assertWaveFall(msg + " fuel", chart, EngineChart.INJECTOR_2, 0.763, 53.04);
|
||||
assertWaveFall(msg + " fuel", chart, EngineChart.INJECTOR_3, 0.763, 417.04);
|
||||
assertWaveFall(msg + " fuel", chart, EngineChart.INJECTOR_4, 0.763, 594.04);
|
||||
|
||||
x = 33.0;
|
||||
assertWave(chart, EngineChart.SPARK_1, 0.133, x, x + 180, x + 360, x + 540);
|
||||
assertWaveNotNull(chart, EngineChart.SPARK_1);
|
||||
assertWaveNull(chart, EngineChart.SPARK_2);
|
||||
|
||||
sendComplexCommand("set global_trigger_offset_angle 130");
|
||||
sendComplexCommand("set injection_offset 369");
|
||||
chart = nextChart();
|
||||
x = 33;
|
||||
assertWave(chart, EngineChart.SPARK_1, 0.133, x, x + 180, x + 360, x + 540);
|
||||
assertWaveNotNull(chart, EngineChart.SPARK_1);
|
||||
|
||||
// let's enable more channels dynamically
|
||||
sendComplexCommand("set_individual_coils_ignition");
|
||||
chart = nextChart();
|
||||
assertWave("Switching Aspire into INDIVIDUAL_COILS mode", chart, EngineChart.SPARK_2, 0.133, x + 540);
|
||||
assertWave(chart, EngineChart.SPARK_3, 0.133, x + 180);
|
||||
assertWaveNotNull("Switching Aspire into INDIVIDUAL_COILS mode", chart, EngineChart.SPARK_2);
|
||||
assertWaveNotNull(chart, EngineChart.SPARK_3);
|
||||
|
||||
ecu.sendCommand("set_whole_timing_map 520");
|
||||
chart = nextChart();
|
||||
x = 58.92;
|
||||
assertWave(chart, EngineChart.SPARK_2, 0.133, x);
|
||||
assertWaveNotNull(chart, EngineChart.SPARK_2);
|
||||
|
||||
// switching to Speed Density
|
||||
ecu.sendCommand("set mock_maf_voltage 2");
|
||||
|
@ -437,11 +418,11 @@ public class FunctionalTest extends RusefiTestBase {
|
|||
chart = nextChart();
|
||||
EcuTestHelper.assertEquals("MAP", 69.12, SensorCentral.getInstance().getValue(Sensor.MAP));
|
||||
//assertEquals(1, SensorCentral.getInstance().getValue(Sensor.));
|
||||
x = 8.88;
|
||||
assertWave(false, msg + " fuel SD #1", chart, EngineChart.INJECTOR_1, 0.577, 0.1, 0.1, x + 180);
|
||||
assertWave(false, msg + " fuel SD #2", chart, EngineChart.INJECTOR_2, 0.577, 0.1, 0.1, x);
|
||||
assertWave(false, msg + " fuel SD #3", chart, EngineChart.INJECTOR_3, 0.577, 0.1, 0.1, x + 360);
|
||||
assertWave(false, msg + " fuel SD #4", chart, EngineChart.INJECTOR_4, 0.577, 0.1, 0.1, x + 540);
|
||||
|
||||
assertWaveNotNull(msg + " fuel SD #1", chart, EngineChart.INJECTOR_1);
|
||||
assertWaveNotNull(msg + " fuel SD #2", chart, EngineChart.INJECTOR_2);
|
||||
assertWaveNotNull(msg + " fuel SD #3", chart, EngineChart.INJECTOR_3);
|
||||
assertWaveNotNull(msg + " fuel SD #4", chart, EngineChart.INJECTOR_4);
|
||||
|
||||
// above hard limit
|
||||
ecu.changeRpm(10000);
|
||||
|
@ -465,7 +446,11 @@ public class FunctionalTest extends RusefiTestBase {
|
|||
}
|
||||
|
||||
private static void assertWaveNotNull(EngineChart chart, String key) {
|
||||
assertTrue(chart.get(key) != null);
|
||||
assertWaveNotNull("", chart, key);
|
||||
}
|
||||
|
||||
private static void assertWaveNotNull(String msg, EngineChart chart, String key) {
|
||||
assertTrue(msg, chart.get(key) != null);
|
||||
}
|
||||
|
||||
private static void assertWaveNoRises(EngineChart chart, String key) {
|
||||
|
|
Loading…
Reference in New Issue