TS project: hide all invalid entries fix #1505

This commit is contained in:
rusefi 2020-06-17 20:51:29 -04:00
parent 4bc557c06d
commit 1c93e45cda
3 changed files with 3 additions and 1 deletions

Binary file not shown.

View File

@ -86,6 +86,8 @@ public class ReaderState {
throw new IllegalStateException("Too many options in " + tunerStudioLine + " capacity=" + totalCount + "/size=" + enums.size());
if (enums.size() <= totalCount / 2)
throw new IllegalStateException("Too many bits allocated for " + enums + " capacity=" + totalCount + "/size=" + enums.size());
for (int i = enums.size(); i < totalCount; i++)
tunerStudioLine += ", \"INVALID\"";
}
state.tsCustomLine.put(name, tunerStudioLine);

View File

@ -47,7 +47,7 @@ public class ConfigFieldParserTest {
CharArrayWriter writer = new CharArrayWriter();
TestTSProjectConsumer javaFieldsConsumer = new TestTSProjectConsumer(writer, "", state);
state.readBufferedReader(reader, Arrays.asList(javaFieldsConsumer));
assertEquals("\tafr_type\t\t\t\t\t = bits, S32, 0, [0:1], \"BPSX\", \"Innovate\", \"14Point7\"\n" +
assertEquals("\tafr_type\t\t\t\t\t = bits, S32, 0, [0:1], \"BPSX\", \"Innovate\", \"14Point7\", \"INVALID\"\n" +
"; total TS size = 4\n", new String(writer.toCharArray()));
}