hardware continues integration needs a high RPM high tooth count test case #1351

expecting a failure - validating test
This commit is contained in:
rusefi 2020-04-23 00:47:40 -04:00
parent 6eea6ec541
commit 79710b4649
2 changed files with 35 additions and 4 deletions

View File

@ -13,6 +13,10 @@ import com.rusefi.io.ConnectionStatus;
import com.rusefi.waves.EngineChart;
import com.rusefi.waves.EngineReport;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import static com.rusefi.IoUtil.*;
import static com.rusefi.IoUtil.getEnableCommand;
import static com.rusefi.TestingUtils.*;
@ -25,7 +29,7 @@ import static com.rusefi.waves.EngineReport.isCloseEnough;
* java -cp rusefi_console.jar com.rusefi.AutoTest
*
* @author Andrey Belomutskiy
* 3/5/14
* 3/5/14
*/
public class AutoTest {
public static final int COMPLEX_COMMAND_RETRY = 10000;
@ -48,6 +52,7 @@ public class AutoTest {
sendCommand(getDisableCommand(Fields.CMD_TRIGGER_HW_INPUT));
sendCommand(getEnableCommand(Fields.CMD_FUNCTIONAL_TEST_MODE));
testCustomEngine();
testVW_60_2();
testMazdaMiata2003();
test2003DodgeNeon();
testFordAspire();
@ -66,6 +71,32 @@ public class AutoTest {
testFordFiesta();
}
private static void testVW_60_2() {
setEngineType(32);
// TODO: we shall get this RPM higher! At the moment things fail at 5500 :(
// first let's get to expected RPM
int rpm = 8500;
changeRpm(rpm);
assertRpmDoesNotJump(rpm);
}
private static void assertRpmDoesNotJump(int rpm) {
AtomicReference failure = new AtomicReference();
SensorCentral.SensorListener listener = new SensorCentral.SensorListener() {
@Override
public void onSensorUpdate(double value) {
double actualRpm = SensorCentral.getInstance().getValue(Sensor.RPM);
if (!isCloseEnough(rpm, actualRpm))
failure.set("Got " + actualRpm + " while trying to stay at " + rpm);
}
};
SensorCentral.getInstance().addListener(Sensor.RPM, listener);
sleep(30);
if (failure.get() != null)
throw new IllegalStateException("Failed " + failure.get());
SensorCentral.getInstance().removeListener(Sensor.RPM, listener);
}
private static void testCustomEngine() {
setEngineType(0);
sendCommand("set_toothed_wheel 4 0");
@ -167,7 +198,7 @@ public class AutoTest {
IoUtil.changeRpm(200);
IoUtil.changeRpm(250); // another approach to artificial delay
IoUtil.changeRpm(200);
assertEquals("VBatt",12, SensorCentral.getInstance().getValue(Sensor.VBATT));
assertEquals("VBatt", 12, SensorCentral.getInstance().getValue(Sensor.VBATT));
chart = nextChart();
double x = 100;
@ -425,7 +456,7 @@ public class AutoTest {
IoUtil.changeRpm(2400);
IoUtil.changeRpm(2000);
chart = nextChart();
assertEquals("MAP",69.12, SensorCentral.getInstance().getValue(Sensor.MAP));
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);

View File

@ -49,7 +49,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
* @see EngineSnifferPanel
*/
public class Launcher {
public static final int CONSOLE_VERSION = 20200418;
public static final int CONSOLE_VERSION = 20200422;
public static final String INI_FILE_PATH = System.getProperty("ini_file_path", "..");
public static final String INPUT_FILES_PATH = System.getProperty("input_files_path", "..");
public static final String TOOLS_PATH = System.getProperty("tools_path", ".");