From 2e98d31671ac5f7758f6ff0bb173461901bd78d2 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Sat, 17 Dec 2022 10:04:25 -0500 Subject: [PATCH] RusEFI console keeps resetting on latest #4899 HW CI coverage? --- .../com/rusefi/f4discovery/CommonFunctionalTest.java | 3 +-- .../java/com/rusefi/proteus/ProteusAnalogTest.java | 12 +++++++++--- .../com/rusefi/binaryprotocol/BinaryProtocol.java | 2 +- .../io/src/main/java/com/rusefi/io/LinkManager.java | 4 ++++ 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/java_console/autotest/src/main/java/com/rusefi/f4discovery/CommonFunctionalTest.java b/java_console/autotest/src/main/java/com/rusefi/f4discovery/CommonFunctionalTest.java index 3d9cc41f59..f9fa626584 100644 --- a/java_console/autotest/src/main/java/com/rusefi/f4discovery/CommonFunctionalTest.java +++ b/java_console/autotest/src/main/java/com/rusefi/f4discovery/CommonFunctionalTest.java @@ -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 *

* java -cp rusefi_console.jar com.rusefi.AutoTest * diff --git a/java_console/autotest/src/main/java/com/rusefi/proteus/ProteusAnalogTest.java b/java_console/autotest/src/main/java/com/rusefi/proteus/ProteusAnalogTest.java index ff481554ef..13e739e944 100644 --- a/java_console/autotest/src/main/java/com/rusefi/proteus/ProteusAnalogTest.java +++ b/java_console/autotest/src/main/java/com/rusefi/proteus/ProteusAnalogTest.java @@ -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 diff --git a/java_console/io/src/main/java/com/rusefi/binaryprotocol/BinaryProtocol.java b/java_console/io/src/main/java/com/rusefi/binaryprotocol/BinaryProtocol.java index 45b8a1e92d..9c81379508 100644 --- a/java_console/io/src/main/java/com/rusefi/binaryprotocol/BinaryProtocol.java +++ b/java_console/io/src/main/java/com/rusefi/binaryprotocol/BinaryProtocol.java @@ -573,7 +573,7 @@ public class BinaryProtocol { return text.getBytes(); } - private String requestPendingTextMessages() { + public String requestPendingTextMessages() { if (isClosed) return null; try { diff --git a/java_console/io/src/main/java/com/rusefi/io/LinkManager.java b/java_console/io/src/main/java/com/rusefi/io/LinkManager.java index ee1c509c85..0320d6a5eb 100644 --- a/java_console/io/src/main/java/com/rusefi/io/LinkManager.java +++ b/java_console/io/src/main/java/com/rusefi/io/LinkManager.java @@ -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();