This commit is contained in:
parent
3721232759
commit
3946e16bf1
|
@ -53,7 +53,7 @@ public class EnumIniField extends IniField {
|
||||||
|
|
||||||
if (ordinal >= enums.size())
|
if (ordinal >= enums.size())
|
||||||
throw new IllegalStateException(ordinal + " in " + getName());
|
throw new IllegalStateException(ordinal + " in " + getName());
|
||||||
return enums.get(ordinal);
|
return "\"" + enums.get(ordinal) + "\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|
|
@ -14,8 +14,7 @@ import org.junit.Test;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.*;
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* from IDEA this unit test needs to be executed with "empty" working directory
|
* from IDEA this unit test needs to be executed with "empty" working directory
|
||||||
|
@ -68,6 +67,19 @@ public class TuneReadWriteTest {
|
||||||
assertNotNull(flow);
|
assertNotNull(flow);
|
||||||
assertEquals("2", flow.getDigits());
|
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
|
// and now reading that XML back
|
||||||
Msq tuneFromFile = Msq.readTune(fileName);
|
Msq tuneFromFile = Msq.readTune(fileName);
|
||||||
assertNotNull(tuneFromFile.getVersionInfo().getSignature());
|
assertNotNull(tuneFromFile.getVersionInfo().getSignature());
|
||||||
|
|
Loading…
Reference in New Issue