diff --git a/java_console/io/src/test/java/com/rusefi/native_/JniUnitTest.java b/java_console/io/src/test/java/com/rusefi/native_/JniUnitTest.java index 26f62d61a8..57477166d1 100644 --- a/java_console/io/src/test/java/com/rusefi/native_/JniUnitTest.java +++ b/java_console/io/src/test/java/com/rusefi/native_/JniUnitTest.java @@ -21,22 +21,19 @@ public class JniUnitTest { engineLogic.invokePeriodicCallback(); - byte[] outputs = engineLogic.getOutputs(); + assertEquals(TS_FILE_VERSION, (int) getValue(engineLogic.getOutputs(), Sensor.FIRMWARE_VERSION)); - assertEquals(TS_FILE_VERSION, (int) getValue(outputs, Sensor.FIRMWARE_VERSION)); - - assertEquals(14.0, getValue(outputs, Sensor.TARGET_AFR)); - double veValue = getValue(outputs, Sensor.veValue); + assertEquals(14.0, getValue(engineLogic.getOutputs(), Sensor.TARGET_AFR)); + double veValue = getValue(engineLogic.getOutputs(), Sensor.veValue); assertTrue("veValue", veValue > 40 && veValue < 90); - assertEquals(18.11, getValue(outputs, Sensor.runningFuel)); + assertEquals(18.11, getValue(engineLogic.getOutputs(), Sensor.runningFuel)); engineLogic.setSensor(SensorType.Rpm.name(), 4000); engineLogic.invokePeriodicCallback(); - // huh? - assertEquals(0.0, getValue(outputs, Sensor.RPM)); + assertEquals(4000.0, getValue(engineLogic.getOutputs(), Sensor.RPM)); - assertEquals(18.11, getValue(outputs, Sensor.runningFuel)); + assertEquals(18.11, getValue(engineLogic.getOutputs(), Sensor.runningFuel)); } private double getValue(byte[] outputs, Sensor sensor) { diff --git a/unit_tests/native/native_impl.cpp b/unit_tests/native/native_impl.cpp index c1acb19e76..8d4c60fb74 100644 --- a/unit_tests/native/native_impl.cpp +++ b/unit_tests/native/native_impl.cpp @@ -47,7 +47,7 @@ JNIEXPORT void JNICALL Java_com_rusefi_native_1_EngineLogic_setSensor SensorType type = findSensorTypeByName(sensorNameNative); - printf("Setting [%s] to %f\n", getSensorType(type), sensorValue); + printf("[native] Setting [%s] to %f\n", getSensorType(type), sensorValue); Sensor::setMockValue(type, sensorValue); env->ReleaseStringUTFChars(sensorName, sensorNameNative);