From bed84fa2d2c89c992661ff4569f72f79a550edd6 Mon Sep 17 00:00:00 2001 From: Andrey Date: Mon, 25 Sep 2023 23:03:00 -0400 Subject: [PATCH] only: isPtr test coverage --- .../com/rusefi/test/SdCardFieldsGeneratorTest.java | 14 +++++++------- .../com/rusefi/test/SdCardFieldsTestConsumer.java | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/java_tools/configuration_definition/src/test/java/com/rusefi/test/SdCardFieldsGeneratorTest.java b/java_tools/configuration_definition/src/test/java/com/rusefi/test/SdCardFieldsGeneratorTest.java index 540fcf980c..9279f7020c 100644 --- a/java_tools/configuration_definition/src/test/java/com/rusefi/test/SdCardFieldsGeneratorTest.java +++ b/java_tools/configuration_definition/src/test/java/com/rusefi/test/SdCardFieldsGeneratorTest.java @@ -34,7 +34,7 @@ public class SdCardFieldsGeneratorTest { "\t{engine->outputChannels.RPMValue, \"hello\", \"RPM\", 2, \"myCategory\"},\n" + "\t{engine->outputChannels.rpmAcceleration, \"dRPM\", \"RPM/s\", 2},\n" + "\t{engine->outputChannels.speedToRpmRatio, \"ra\", \"value\", 0},\n" + - "", actor); + "", actor, false); } @Test @@ -44,7 +44,7 @@ public class SdCardFieldsGeneratorTest { "bit sd_logging_internal\n" + "end_struct", "\t{engine->outputChannels.RPMValue, \"feee\", \"RPM\", 2},\n", readerState -> { - }); + }, false); } @Test @@ -56,7 +56,7 @@ public class SdCardFieldsGeneratorTest { "\t{engine->outputChannels.recentErrorCode[2], \"recentErrorCode 3\", \"error\", 0},\n" + "\t{engine->outputChannels.recentErrorCode[3], \"recentErrorCode 4\", \"error\", 0},\n", readerState -> { - }); + }, false); } @Test @@ -67,21 +67,21 @@ public class SdCardFieldsGeneratorTest { " end_struct\n" + "\tpid_status_s alternatorStatus\n" + "end_struct", - "\t{engine->outputChannels.alternatorStatus.pTerm, \"alternatorStatus.pTerm\", \"\", 2},\n", + "\t{engine->outputChannels->alternatorStatus.pTerm, \"alternatorStatus.pTerm\", \"\", 2},\n", readerState -> { - }); + }, true); } interface Actor { void act(ReaderStateImpl readerState); } - private static void processAndAssert(String input, String expectedOutput, Actor actor) { + private static void processAndAssert(String input, String expectedOutput, Actor actor, boolean isPtr) { ReaderStateImpl state = new ReaderStateImpl(null, LazyFile.REAL); actor.act(state); - SdCardFieldsTestConsumer consumer = new SdCardFieldsTestConsumer(LazyFile.TEST); + SdCardFieldsTestConsumer consumer = new SdCardFieldsTestConsumer(LazyFile.TEST, isPtr); state.readBufferedReader(input, consumer); assertEquals(expectedOutput, consumer.getBody()); } diff --git a/java_tools/configuration_definition/src/test/java/com/rusefi/test/SdCardFieldsTestConsumer.java b/java_tools/configuration_definition/src/test/java/com/rusefi/test/SdCardFieldsTestConsumer.java index e666d5e073..c6e35f4321 100644 --- a/java_tools/configuration_definition/src/test/java/com/rusefi/test/SdCardFieldsTestConsumer.java +++ b/java_tools/configuration_definition/src/test/java/com/rusefi/test/SdCardFieldsTestConsumer.java @@ -19,8 +19,9 @@ public class SdCardFieldsTestConsumer implements ConfigurationConsumer { private final SdCardFieldsContent content = new SdCardFieldsContent(); private final LazyFile output; - public SdCardFieldsTestConsumer(String outputFileName) { + public SdCardFieldsTestConsumer(String outputFileName, boolean isPtr) { output = new LazyFileImpl(outputFileName); + content.isPtr = isPtr; } @Override