RusEFI console keeps resetting on latest #4899

HW CI coverage?
This commit is contained in:
rusefillc 2022-12-17 10:04:25 -05:00
parent 9170db9792
commit 2e98d31671
4 changed files with 15 additions and 6 deletions

View File

@ -13,12 +13,11 @@ import java.util.Arrays;
import static com.rusefi.IoUtil.getEnableCommand;
import static com.rusefi.TestingUtils.assertNull;
import static com.rusefi.config.generated.Fields.*;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
/**
* rusEfi firmware simulator functional test suite
* rusEFI firmware simulator functional test suite
* <p/>
* java -cp rusefi_console.jar com.rusefi.AutoTest
*

View File

@ -8,8 +8,7 @@ import org.junit.Test;
import static com.rusefi.config.generated.Fields.*;
import static com.rusefi.IoUtil.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.*;
/*
This test requires a particular hardware setup connected to a Proteus board.
@ -27,7 +26,14 @@ public class ProteusAnalogTest extends RusefiTestBase {
assertTrue(vbatt < 13);
}
void setIdlePositionAndAssertTps(int idle, int expectedTps) {
// not really 'analog' test is this best but since we are unable to rebuild HW CI :(
@Test
public void testTextPull() {
String text = ecu.getLinkManager().getBinaryProtocol().requestPendingTextMessages();
assertNotNull("Not null text protocol response expected", text);
}
private void setIdlePositionAndAssertTps(int idle, int expectedTps) {
ecu.sendCommand("set idle_position " + idle);
// wait a sec for sensors to update

View File

@ -573,7 +573,7 @@ public class BinaryProtocol {
return text.getBytes();
}
private String requestPendingTextMessages() {
public String requestPendingTextMessages() {
if (isClosed)
return null;
try {

View File

@ -125,6 +125,10 @@ public class LinkManager implements Closeable {
return names.toArray(new String[0]);
}
public BinaryProtocol getBinaryProtocol() {
return getCurrentStreamState();
}
public BinaryProtocol getCurrentStreamState() {
Objects.requireNonNull(connector, "connector");
return connector.getBinaryProtocol();