rusefi 2020-07-31 12:36:53 -04:00
parent 3721232759
commit 3946e16bf1
2 changed files with 15 additions and 3 deletions

View File

@ -53,7 +53,7 @@ public class EnumIniField extends IniField {
if (ordinal >= enums.size())
throw new IllegalStateException(ordinal + " in " + getName());
return enums.get(ordinal);
return "\"" + enums.get(ordinal) + "\"";
}
@NotNull

View File

@ -14,8 +14,7 @@ import org.junit.Test;
import java.nio.file.Files;
import java.nio.file.Path;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.*;
/**
* from IDEA this unit test needs to be executed with "empty" working directory
@ -68,6 +67,19 @@ public class TuneReadWriteTest {
assertNotNull(flow);
assertEquals("2", flow.getDigits());
Constant nonEmptyFormula = tuneFromBinary.findPage().findParameter("fsioFormulas1");
assertNotNull(nonEmptyFormula);;
/**
* Empty strings values should be omitted from the tune
*/
Constant emptyFormula = tuneFromBinary.findPage().findParameter("fsioFormulas2");
assertNull(emptyFormula);;
Constant enumField = tuneFromBinary.findPage().findParameter("acRelayPin");
// quotes are expected
assertEquals("\"NONE\"", enumField.getValue());
// and now reading that XML back
Msq tuneFromFile = Msq.readTune(fileName);
assertNotNull(tuneFromFile.getVersionInfo().getSignature());