From 4c93418599a4ebfa00adcf88951954a096842cae Mon Sep 17 00:00:00 2001 From: rusefillc Date: Sun, 14 Aug 2022 18:20:49 -0400 Subject: [PATCH] TODO: We have to move either forward or backwards with newparse #4441 --- .../com/rusefi/newparse/outputs/TsWriter.java | 1 + .../rusefi/output/OutputsSectionConsumer.java | 1 + .../java/com/rusefi/test/OutputsTest.java | 56 +++++-------------- .../rusefi/test/newParse/NewParseHelper.java | 2 + 4 files changed, 17 insertions(+), 43 deletions(-) diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/newparse/outputs/TsWriter.java b/java_tools/configuration_definition/src/main/java/com/rusefi/newparse/outputs/TsWriter.java index 72b61a6cbe..6a8088194e 100644 --- a/java_tools/configuration_definition/src/main/java/com/rusefi/newparse/outputs/TsWriter.java +++ b/java_tools/configuration_definition/src/main/java/com/rusefi/newparse/outputs/TsWriter.java @@ -14,6 +14,7 @@ public class TsWriter { private static final Pattern OPTIONAL_LINE = Pattern.compile("@@if_([a-zA-Z0-9_]+)"); + // TODO: We have to move either forward or backwards with newparse #4441 public void writeTunerstudio(ParseState parser, String inputFile, String outputFile) throws IOException { PrintStream ps = new PrintStreamAlwaysUnix(new FileOutputStream(outputFile)); writeTunerstudio(parser, inputFile, ps); diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/output/OutputsSectionConsumer.java b/java_tools/configuration_definition/src/main/java/com/rusefi/output/OutputsSectionConsumer.java index ff27d52674..72d38a645a 100644 --- a/java_tools/configuration_definition/src/main/java/com/rusefi/output/OutputsSectionConsumer.java +++ b/java_tools/configuration_definition/src/main/java/com/rusefi/output/OutputsSectionConsumer.java @@ -5,6 +5,7 @@ import com.rusefi.ReaderState; import java.io.*; /** + * TODO: We have to move either forward or backwards with newparse #4441 * [OutputChannels] */ public class OutputsSectionConsumer implements ConfigurationConsumer { diff --git a/java_tools/configuration_definition/src/test/java/com/rusefi/test/OutputsTest.java b/java_tools/configuration_definition/src/test/java/com/rusefi/test/OutputsTest.java index 8bebc35b4f..867f4208c3 100644 --- a/java_tools/configuration_definition/src/test/java/com/rusefi/test/OutputsTest.java +++ b/java_tools/configuration_definition/src/test/java/com/rusefi/test/OutputsTest.java @@ -2,11 +2,15 @@ package com.rusefi.test; import com.rusefi.BitState; import com.rusefi.ReaderState; -import com.rusefi.output.*; +import com.rusefi.output.DataLogConsumer; +import com.rusefi.output.GaugeConsumer; +import com.rusefi.output.GetOutputValueConsumer; +import com.rusefi.output.OutputsSectionConsumer; import org.junit.Test; import java.io.IOException; +import static com.rusefi.test.newParse.NewParseHelper.parseToOutputChannels; import static org.junit.Assert.assertEquals; public class OutputsTest { @@ -23,48 +27,14 @@ public class OutputsTest { "float tCharge;speed density\n" + "end_struct\n"; - OutputsSectionConsumer tsProjectConsumer = new OutputsSectionConsumer(null); - state.readBufferedReader(test, tsProjectConsumer); - - - assertEquals("afr_type = scalar, F32, 0, \"ms\", 1, 0\n" + - "afr_typet = scalar, U08, 4, \"ms\", 1, 0\n" + - "isForcedInduction = bits, U32, 8, [0:0]\n" + - "enableFan1WithAc = bits, U32, 8, [1:1]\n" + - "unusedBit_5_2 = bits, U32, 8, [2:2]\n" + - "unusedBit_5_3 = bits, U32, 8, [3:3]\n" + - "unusedBit_5_4 = bits, U32, 8, [4:4]\n" + - "unusedBit_5_5 = bits, U32, 8, [5:5]\n" + - "unusedBit_5_6 = bits, U32, 8, [6:6]\n" + - "unusedBit_5_7 = bits, U32, 8, [7:7]\n" + - "unusedBit_5_8 = bits, U32, 8, [8:8]\n" + - "unusedBit_5_9 = bits, U32, 8, [9:9]\n" + - "unusedBit_5_10 = bits, U32, 8, [10:10]\n" + - "unusedBit_5_11 = bits, U32, 8, [11:11]\n" + - "unusedBit_5_12 = bits, U32, 8, [12:12]\n" + - "unusedBit_5_13 = bits, U32, 8, [13:13]\n" + - "unusedBit_5_14 = bits, U32, 8, [14:14]\n" + - "unusedBit_5_15 = bits, U32, 8, [15:15]\n" + - "unusedBit_5_16 = bits, U32, 8, [16:16]\n" + - "unusedBit_5_17 = bits, U32, 8, [17:17]\n" + - "unusedBit_5_18 = bits, U32, 8, [18:18]\n" + - "unusedBit_5_19 = bits, U32, 8, [19:19]\n" + - "unusedBit_5_20 = bits, U32, 8, [20:20]\n" + - "unusedBit_5_21 = bits, U32, 8, [21:21]\n" + - "unusedBit_5_22 = bits, U32, 8, [22:22]\n" + - "unusedBit_5_23 = bits, U32, 8, [23:23]\n" + - "unusedBit_5_24 = bits, U32, 8, [24:24]\n" + - "unusedBit_5_25 = bits, U32, 8, [25:25]\n" + - "unusedBit_5_26 = bits, U32, 8, [26:26]\n" + - "unusedBit_5_27 = bits, U32, 8, [27:27]\n" + - "unusedBit_5_28 = bits, U32, 8, [28:28]\n" + - "unusedBit_5_29 = bits, U32, 8, [29:29]\n" + - "unusedBit_5_30 = bits, U32, 8, [30:30]\n" + - "unusedBit_5_31 = bits, U32, 8, [31:31]\n" + - "m_requested_pump = scalar, F32, 12, \"\", 1, 0\n" + - "tCharge = scalar, F32, 16, \"\", 1, 0\n" + - "; total TS size = 20\n", tsProjectConsumer.getContent()); - + String expected = "root_afr_type = scalar, F32, 0, \"ms\", 1, 0\n" + + "root_afr_typet = scalar, U08, 4, \"ms\", 1, 0\n" + + "root_isForcedInduction = bits, U32, 8, [0:0]\n" + + "root_enableFan1WithAc = bits, U32, 8, [1:1]\n" + + "root_m_requested_pump = scalar, F32, 12, \"\", 1, 0\n" + + "root_tCharge = scalar, F32, 16, \"\", 1, 0\n" + + "; total TS size = 20\n"; + assertEquals(expected, parseToOutputChannels(test)); } @Test(expected = BitState.TooManyBitsInARow.class) diff --git a/java_tools/configuration_definition/src/test/java/com/rusefi/test/newParse/NewParseHelper.java b/java_tools/configuration_definition/src/test/java/com/rusefi/test/newParse/NewParseHelper.java index dde7fe38fb..44186f2701 100644 --- a/java_tools/configuration_definition/src/test/java/com/rusefi/test/newParse/NewParseHelper.java +++ b/java_tools/configuration_definition/src/test/java/com/rusefi/test/newParse/NewParseHelper.java @@ -17,6 +17,7 @@ public class NewParseHelper { return parseState; } + // TODO: We have to move either forward or backwards with newparse #4441 public static String parseToTs(String input) throws IOException { ParseState state = parse(input); @@ -46,6 +47,7 @@ public class NewParseHelper { return baos.toString(utf8); } + // TODO: We have to move either forward or backwards with newparse #4441 public static String parseToC(String input) throws IOException { ParseState state = parse(input);