only:helping build

This commit is contained in:
Andrey 2023-06-17 21:17:48 -04:00
parent f3cfd8c6c9
commit 126f4a736a
8 changed files with 24 additions and 12 deletions

View File

@ -1,4 +1,5 @@
include ':trigger-image'
include ':tune-tools'
include ':proxy_server'
// gradle naming convention does not like '_' symbol
project(':proxy_server').projectDir = new File('proxy_server')

View File

@ -0,0 +1,9 @@
plugins {
id 'java-library'
}
dependencies {
api project(':config_definition')
api project(':models')
api project(':ecu_io')
}

View File

@ -9,6 +9,7 @@ import com.rusefi.output.ConfigStructure;
import com.rusefi.tune.xml.Constant;
import com.rusefi.tune.xml.Msq;
import com.rusefi.tune.xml.Page;
import org.junit.Assert;
import org.junit.Test;
import java.nio.file.Files;
@ -82,7 +83,7 @@ public class LoadOlderTuneTest {
int ordinal;
try {
ordinal = TuneTools.resolveEnumByName(customEnum, unquote(customValue.getValue()));
ordinal = TuneTools.resolveEnumByName(customEnum, VariableRegistry.unquote(customValue.getValue()));
} catch (IllegalStateException e) {
System.out.println("Looks like things were renamed: " + customValue.getValue() + " not found in " + customEnum);
continue;
@ -133,14 +134,14 @@ public class LoadOlderTuneTest {
public void testLegacyCustomEnumOrdinal() {
String tsCustomLine = "bits, U08, @OFFSET@, [0:1], \"Single Coil\", \"Individual Coils\", \"Wasted Spark\", \"Two Distributors\"";
assertEquals(0, TuneTools.resolveEnumByName(tsCustomLine, "One coil"));
Assert.assertEquals(0, TuneTools.resolveEnumByName(tsCustomLine, "One coil"));
}
@Test
public void testCustomEnumOrdinal() {
String tsCustomLine = "bits, U08, @OFFSET@, [0:1], \"Single Coil\", \"Individual Coils\", \"Wasted Spark\", \"Two Distributors\"";
assertEquals(0, TuneTools.resolveEnumByName(tsCustomLine, "Single coil"));
assertEquals(3, TuneTools.resolveEnumByName(tsCustomLine, "Two Distributors"));
Assert.assertEquals(0, TuneTools.resolveEnumByName(tsCustomLine, "Single coil"));
Assert.assertEquals(3, TuneTools.resolveEnumByName(tsCustomLine, "Two Distributors"));
}
}

View File

@ -9,6 +9,7 @@ import com.rusefi.tools.tune.CurveData;
import com.rusefi.tools.tune.TS2C;
import com.rusefi.tune.xml.Constant;
import com.rusefi.tune.xml.Msq;
import org.junit.Assert;
import org.junit.Test;
import java.io.IOException;
@ -30,9 +31,9 @@ public class TuneReadWriteTest {
@Test
public void testIniReader() throws IOException {
assertTrue(model.getTables().contains("fueltable"));
assertEquals(21, model.getTables().size());
assertEquals("fuelRpmBins", model.getXBin("FUELTable"));
assertEquals("fuelLoadBins", model.getYBin("fuelTable"));
Assert.assertEquals(21, model.getTables().size());
Assert.assertEquals("fuelRpmBins", model.getXBin("FUELTable"));
Assert.assertEquals("fuelLoadBins", model.getYBin("fuelTable"));
String tableName = "ignitionIatCorrTable";
String xRpmBinsName = model.getXBin(tableName);
@ -42,7 +43,7 @@ public class TuneReadWriteTest {
CurveData xRpmCurve = CurveData.valueOf(TUNE_NAME, xRpmBinsName, model);
assertEquals("static const float hardCodedignitionIatCorrRpmBins[16] = " +
Assert.assertEquals("static const float hardCodedignitionIatCorrRpmBins[16] = " +
"{880.0, 1260.0, 1640.0, 2020.0, 2400.0, 2780.0, 3000.0, 3380.0, 3760.0, 4140.0, 4520.0, 5000.0, 5700.0, 6500.0, 7200.0, 8000.0};\n" +
"\n", xRpmCurve.getCsourceCode());
@ -142,7 +143,7 @@ public class TuneReadWriteTest {
Constant flow = tsTune.findPage().findParameter("injector_flow");
assertNotNull(flow);
assertEquals("2", flow.getDigits());
Assert.assertEquals("2", flow.getDigits());
ConfigurationImage tsBinaryData = tsTune.asImage(model, LEGACY_TOTAL_CONFIG_SIZE);
@ -166,11 +167,11 @@ public class TuneReadWriteTest {
Constant batteryCorrection = tuneFromBinary.findPage().findParameter("injector_battLagCorrBins");
assertNotNull(batteryCorrection);
assertEquals("2", batteryCorrection.getDigits());
Assert.assertEquals("2", batteryCorrection.getDigits());
Constant flow = tuneFromBinary.findPage().findParameter("injector_flow");
assertNotNull(flow);
assertEquals("2", flow.getDigits());
Assert.assertEquals("2", flow.getDigits());
Constant nonEmptyFormula = tuneFromBinary.findPage().findParameter("fsioFormulas1");
assertNotNull(nonEmptyFormula);
@ -183,7 +184,7 @@ public class TuneReadWriteTest {
Constant enumField = tuneFromBinary.findPage().findParameter("acRelayPin");
// quotes are expected
assertEquals("\"NONE\"", enumField.getValue());
Assert.assertEquals("\"NONE\"", enumField.getValue());
// and now reading that XML back
Msq tuneFromFile = Msq.readTune(fileName);