only:junit5
This commit is contained in:
parent
9644a01d10
commit
c2b1ba7e01
|
@ -2,8 +2,8 @@ package com.rusefi.pinout;
|
||||||
|
|
||||||
import com.rusefi.ReaderStateImpl;
|
import com.rusefi.ReaderStateImpl;
|
||||||
import com.rusefi.newparse.DefinitionsState;
|
import com.rusefi.newparse.DefinitionsState;
|
||||||
import org.junit.Ignore;
|
import org.junit.jupiter.api.Disabled;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import static junit.framework.TestCase.assertFalse;
|
||||||
|
|
||||||
public class PinoutLogicHellen112_17_Test {
|
public class PinoutLogicHellen112_17_Test {
|
||||||
@Test
|
@Test
|
||||||
@Ignore // this was only useful while figuring out the problem
|
@Disabled // this was only useful while figuring out the problem
|
||||||
public void testRealFiled() throws IOException {
|
public void testRealFiled() throws IOException {
|
||||||
// a bit nasty, do we have similar anywhere else already?
|
// a bit nasty, do we have similar anywhere else already?
|
||||||
FileSystemBoardInputsReaderImpl.PREFIX = FIRMWARE + File.separator;
|
FileSystemBoardInputsReaderImpl.PREFIX = FIRMWARE + File.separator;
|
||||||
|
|
|
@ -3,7 +3,7 @@ package com.rusefi.pinout;
|
||||||
import com.rusefi.ReaderStateImpl;
|
import com.rusefi.ReaderStateImpl;
|
||||||
import com.rusefi.enum_reader.Value;
|
import com.rusefi.enum_reader.Value;
|
||||||
import com.rusefi.newparse.DefinitionsState;
|
import com.rusefi.newparse.DefinitionsState;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.rusefi.pinout;
|
||||||
|
|
||||||
import com.rusefi.EnumsReader;
|
import com.rusefi.EnumsReader;
|
||||||
import com.rusefi.enum_reader.Value;
|
import com.rusefi.enum_reader.Value;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
|
@ -4,7 +4,7 @@ import com.rusefi.ReaderStateImpl;
|
||||||
import com.rusefi.TsFileContent;
|
import com.rusefi.TsFileContent;
|
||||||
import com.rusefi.output.TSProjectConsumer;
|
import com.rusefi.output.TSProjectConsumer;
|
||||||
import com.rusefi.util.Output;
|
import com.rusefi.util.Output;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.rusefi.test;
|
package com.rusefi.test;
|
||||||
|
|
||||||
import com.rusefi.output.BaseCHeaderConsumer;
|
import com.rusefi.output.BaseCHeaderConsumer;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ package com.rusefi.test;
|
||||||
import com.rusefi.EnumsReader;
|
import com.rusefi.EnumsReader;
|
||||||
import com.rusefi.VariableRegistry;
|
import com.rusefi.VariableRegistry;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileReader;
|
import java.io.FileReader;
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.rusefi.test;
|
||||||
|
|
||||||
import com.rusefi.ReaderStateImpl;
|
import com.rusefi.ReaderStateImpl;
|
||||||
import com.rusefi.output.JavaFieldsConsumer;
|
import com.rusefi.output.JavaFieldsConsumer;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,9 @@ package com.rusefi.test;
|
||||||
import com.rusefi.*;
|
import com.rusefi.*;
|
||||||
import com.rusefi.output.*;
|
import com.rusefi.output.*;
|
||||||
import com.rusefi.parse.TypesHelper;
|
import com.rusefi.parse.TypesHelper;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Andrey Belomutskiy, (c) 2013-2020
|
* Andrey Belomutskiy, (c) 2013-2020
|
||||||
|
@ -22,7 +22,7 @@ public class ConfigFieldParserTest {
|
||||||
assertEquals(cf.getArraySizes().length, 1);
|
assertEquals(cf.getArraySizes().length, 1);
|
||||||
assertEquals(cf.getArraySizes()[0], 8);
|
assertEquals(cf.getArraySizes()[0], 8);
|
||||||
assertEquals(cf.getSize(null), 8);
|
assertEquals(cf.getSize(null), 8);
|
||||||
assertFalse("isIterate", cf.isIterate());
|
assertFalse(cf.isIterate(), "isIterate");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ public class ConfigFieldParserTest {
|
||||||
assertEquals(cf.getArraySizes()[0], 8);
|
assertEquals(cf.getArraySizes()[0], 8);
|
||||||
assertEquals(cf.getArraySizes()[1], 16);
|
assertEquals(cf.getArraySizes()[1], 16);
|
||||||
assertEquals(cf.getSize(null), 128);
|
assertEquals(cf.getSize(null), 128);
|
||||||
assertFalse("isIterate", cf.isIterate());
|
assertFalse(cf.isIterate(), "isIterate");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,8 +68,9 @@ public class ConfigFieldParserTest {
|
||||||
"; total TS size = 12\n", tsProjectConsumer.getContent());
|
"; total TS size = 12\n", tsProjectConsumer.getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = IllegalStateException.class)
|
@Test
|
||||||
public void testSameFieldTwice() {
|
public void testSameFieldTwice() {
|
||||||
|
assertThrows(IllegalStateException.class, () -> {
|
||||||
String test = "struct pid_s\n" +
|
String test = "struct pid_s\n" +
|
||||||
"int afr_type1;PID dTime;\"ms\", 1, 0, 0, 3000, 0\n" +
|
"int afr_type1;PID dTime;\"ms\", 1, 0, 0, 3000, 0\n" +
|
||||||
"int afr_type2;PID dTime;\"ms\", 1, 0, 0, 3000, 0\n" +
|
"int afr_type2;PID dTime;\"ms\", 1, 0, 0, 3000, 0\n" +
|
||||||
|
@ -79,6 +80,7 @@ public class ConfigFieldParserTest {
|
||||||
|
|
||||||
BaseCHeaderConsumer consumer = new BaseCHeaderConsumer();
|
BaseCHeaderConsumer consumer = new BaseCHeaderConsumer();
|
||||||
state.readBufferedReader(test, consumer);
|
state.readBufferedReader(test, consumer);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -205,13 +207,15 @@ public class ConfigFieldParserTest {
|
||||||
new ReaderStateImpl().readBufferedReader(test);
|
new ReaderStateImpl().readBufferedReader(test);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = IllegalStateException.class)
|
@Test
|
||||||
public void invalidDefine() {
|
public void invalidDefine() {
|
||||||
|
assertThrows(IllegalStateException.class, () -> {
|
||||||
String test = "struct pid_s\n" +
|
String test = "struct pid_s\n" +
|
||||||
VariableRegistry.DEFINE + " show show_Hellen121vag_presets true\n" +
|
VariableRegistry.DEFINE + " show show_Hellen121vag_presets true\n" +
|
||||||
"end_struct\n" +
|
"end_struct\n" +
|
||||||
"";
|
"";
|
||||||
new ReaderStateImpl().readBufferedReader(test);
|
new ReaderStateImpl().readBufferedReader(test);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -364,7 +368,7 @@ public class ConfigFieldParserTest {
|
||||||
ConfigFieldImpl cf = ConfigFieldImpl.parse(state, "int field");
|
ConfigFieldImpl cf = ConfigFieldImpl.parse(state, "int field");
|
||||||
assertEquals(cf.getType(), "int");
|
assertEquals(cf.getType(), "int");
|
||||||
|
|
||||||
assertEquals("Name", cf.getName(), "field");
|
assertEquals(cf.getName(), "field", "Unexpected Field Name");
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -671,7 +675,7 @@ public class ConfigFieldParserTest {
|
||||||
{
|
{
|
||||||
ConfigFieldImpl cf = ConfigFieldImpl.parse(state, "int field");
|
ConfigFieldImpl cf = ConfigFieldImpl.parse(state, "int field");
|
||||||
assertEquals(cf.getType(), "int");
|
assertEquals(cf.getType(), "int");
|
||||||
assertEquals("Name", cf.getName(), "field");
|
assertEquals(cf.getName(), "field", "Name");
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
ConfigFieldImpl cf = ConfigFieldImpl.parse(state, "int_4 fie4_ld");
|
ConfigFieldImpl cf = ConfigFieldImpl.parse(state, "int_4 fie4_ld");
|
||||||
|
@ -682,7 +686,7 @@ public class ConfigFieldParserTest {
|
||||||
ConfigFieldImpl cf = ConfigFieldImpl.parse(state, "int_8 fi_eld;comm_;ts,1,1");
|
ConfigFieldImpl cf = ConfigFieldImpl.parse(state, "int_8 fi_eld;comm_;ts,1,1");
|
||||||
assertEquals(cf.getType(), "int_8");
|
assertEquals(cf.getType(), "int_8");
|
||||||
assertEquals(cf.getName(), "fi_eld");
|
assertEquals(cf.getName(), "fi_eld");
|
||||||
assertEquals("Comment", cf.getComment(), "comm_");
|
assertEquals(cf.getComment(), "comm_", "Comment");
|
||||||
assertEquals(cf.getTsInfo(), "ts,1,1");
|
assertEquals(cf.getTsInfo(), "ts,1,1");
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
@ -690,7 +694,7 @@ public class ConfigFieldParserTest {
|
||||||
assertEquals(cf.getType(), "int");
|
assertEquals(cf.getType(), "int");
|
||||||
assertEquals(cf.getArraySizes().length, 1);
|
assertEquals(cf.getArraySizes().length, 1);
|
||||||
assertEquals(cf.getArraySizes()[0], 3);
|
assertEquals(cf.getArraySizes()[0], 3);
|
||||||
assertTrue("isIterate", cf.isIterate());
|
assertTrue(cf.isIterate(), "isIterate");
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
ConfigFieldImpl cf = ConfigFieldImpl.parse(state, "int16_t crankingRpm;This,. value controls what RPM values we consider 'cranking' (any RPM below 'crankingRpm')\\nAnything above 'crankingRpm' would be 'running'");
|
ConfigFieldImpl cf = ConfigFieldImpl.parse(state, "int16_t crankingRpm;This,. value controls what RPM values we consider 'cranking' (any RPM below 'crankingRpm')\\nAnything above 'crankingRpm' would be 'running'");
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.rusefi.test;
|
||||||
|
|
||||||
import com.rusefi.EnumsReader;
|
import com.rusefi.EnumsReader;
|
||||||
import com.rusefi.ReaderStateImpl;
|
import com.rusefi.ReaderStateImpl;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.rusefi.test;
|
package com.rusefi.test;
|
||||||
|
|
||||||
import com.rusefi.FiringOrderTSLogic;
|
import com.rusefi.FiringOrderTSLogic;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
public class FiringOrderTSLogicTest {
|
public class FiringOrderTSLogicTest {
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.rusefi.test;
|
||||||
|
|
||||||
import com.rusefi.ReaderStateImpl;
|
import com.rusefi.ReaderStateImpl;
|
||||||
import com.rusefi.output.FragmentDialogConsumer;
|
import com.rusefi.output.FragmentDialogConsumer;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,11 @@ package com.rusefi.test;
|
||||||
import com.rusefi.MaybeSemicolonWasMissedException;
|
import com.rusefi.MaybeSemicolonWasMissedException;
|
||||||
import com.rusefi.ReaderStateImpl;
|
import com.rusefi.ReaderStateImpl;
|
||||||
import com.rusefi.output.GetConfigValueConsumer;
|
import com.rusefi.output.GetConfigValueConsumer;
|
||||||
import org.junit.Test;
|
import org.junit.function.ThrowingRunnable;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertThrows;
|
||||||
|
|
||||||
public class GetConfigValueConsumerTest {
|
public class GetConfigValueConsumerTest {
|
||||||
@Test
|
@Test
|
||||||
|
@ -260,8 +262,9 @@ public class GetConfigValueConsumerTest {
|
||||||
"\n", getConfigValueConsumer.getMdContent());
|
"\n", getConfigValueConsumer.getMdContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = MaybeSemicolonWasMissedException.class)
|
@Test
|
||||||
public void generateSuspiciousTsInfo() {
|
public void generateSuspiciousTsInfo() {
|
||||||
|
assertThrows(MaybeSemicolonWasMissedException.class, () -> {
|
||||||
String test = "struct total\n" +
|
String test = "struct total\n" +
|
||||||
"uint8_t hello;\"unit\", 1, 0, 0, 100, 0\n" +
|
"uint8_t hello;\"unit\", 1, 0, 0, 100, 0\n" +
|
||||||
"end_struct\n";
|
"end_struct\n";
|
||||||
|
@ -270,5 +273,6 @@ public class GetConfigValueConsumerTest {
|
||||||
|
|
||||||
GetConfigValueConsumer getConfigValueConsumer = new GetConfigValueConsumer();
|
GetConfigValueConsumer getConfigValueConsumer = new GetConfigValueConsumer();
|
||||||
state.readBufferedReader(test, getConfigValueConsumer);
|
state.readBufferedReader(test, getConfigValueConsumer);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ package com.rusefi.test;
|
||||||
import com.rusefi.ReaderStateImpl;
|
import com.rusefi.ReaderStateImpl;
|
||||||
import com.rusefi.output.GetOutputValueConsumer;
|
import com.rusefi.output.GetOutputValueConsumer;
|
||||||
import com.rusefi.util.LazyFile;
|
import com.rusefi.util.LazyFile;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.rusefi.test;
|
package com.rusefi.test;
|
||||||
|
|
||||||
import com.rusefi.output.HashUtil;
|
import com.rusefi.output.HashUtil;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.rusefi.test;
|
||||||
|
|
||||||
import com.rusefi.ReaderStateImpl;
|
import com.rusefi.ReaderStateImpl;
|
||||||
import com.rusefi.output.JavaSensorsConsumer;
|
import com.rusefi.output.JavaSensorsConsumer;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,11 @@ import com.rusefi.output.DataLogConsumer;
|
||||||
import com.rusefi.output.GaugeConsumer;
|
import com.rusefi.output.GaugeConsumer;
|
||||||
import com.rusefi.output.OutputsSectionConsumer;
|
import com.rusefi.output.OutputsSectionConsumer;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.junit.Test;
|
import org.junit.function.ThrowingRunnable;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertThrows;
|
||||||
|
|
||||||
public class OutputsTest {
|
public class OutputsTest {
|
||||||
@Test
|
@Test
|
||||||
|
@ -35,8 +37,9 @@ public class OutputsTest {
|
||||||
assertEquals(expectedLegacy, runOriginalImplementation(test, state).getContent());
|
assertEquals(expectedLegacy, runOriginalImplementation(test, state).getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = BitState.TooManyBitsInARow.class)
|
@Test
|
||||||
public void tooManyBits() {
|
public void tooManyBits() {
|
||||||
|
assertThrows(BitState.TooManyBitsInARow.class, () -> {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
for (int i = 0; i < 40; i++)
|
for (int i = 0; i < 40; i++)
|
||||||
sb.append("bit b" + i + "\n");
|
sb.append("bit b" + i + "\n");
|
||||||
|
@ -44,6 +47,7 @@ public class OutputsTest {
|
||||||
sb +
|
sb +
|
||||||
"end_struct\n";
|
"end_struct\n";
|
||||||
runOriginalImplementation(test);
|
runOriginalImplementation(test);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static OutputsSectionConsumer runOriginalImplementation(String test) {
|
private static OutputsSectionConsumer runOriginalImplementation(String test) {
|
||||||
|
@ -191,8 +195,10 @@ public class OutputsTest {
|
||||||
"\ttriggerSimulatorPins3 = \"Each rusEFI piece can provide synthetic trigger signal for external ECU. Sometimes these wires are routed back into trigger inputs of the same rusEFI board.\\nSee also directSelfStimulation which is different. 3\"\n", tsProjectConsumer.getSettingContextHelpForUnitTest());
|
"\ttriggerSimulatorPins3 = \"Each rusEFI piece can provide synthetic trigger signal for external ECU. Sometimes these wires are routed back into trigger inputs of the same rusEFI board.\\nSee also directSelfStimulation which is different. 3\"\n", tsProjectConsumer.getSettingContextHelpForUnitTest());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = IllegalStateException.class)
|
@Test
|
||||||
public void nameDuplicate() {
|
public void nameDuplicate() {
|
||||||
|
assertThrows(IllegalStateException.class, () -> {
|
||||||
|
System.out.println("run");
|
||||||
String test = "struct total\n" +
|
String test = "struct total\n" +
|
||||||
"float afr_type;PID dTime;\"ms\", 1, 0, 0, 3000, 0\n" +
|
"float afr_type;PID dTime;\"ms\", 1, 0, 0, 3000, 0\n" +
|
||||||
"uint8_t afr_type;123;\"ms\", 1, 0, 0, 3000, 0\n" +
|
"uint8_t afr_type;123;\"ms\", 1, 0, 0, 3000, 0\n" +
|
||||||
|
@ -203,6 +209,7 @@ public class OutputsTest {
|
||||||
"afr_type = scalar, U08, 0, \"ms\", 1, 0\n" +
|
"afr_type = scalar, U08, 0, \"ms\", 1, 0\n" +
|
||||||
"; total TS size = 1\n";
|
"; total TS size = 1\n";
|
||||||
assertEquals(expectedLegacy, runOriginalImplementation(test).getContent());
|
assertEquals(expectedLegacy, runOriginalImplementation(test).getContent());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -5,7 +5,7 @@ import static org.junit.Assert.assertEquals;
|
||||||
import com.rusefi.ReaderStateImpl;
|
import com.rusefi.ReaderStateImpl;
|
||||||
|
|
||||||
import com.rusefi.util.LazyFile;
|
import com.rusefi.util.LazyFile;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
public class SdCardFieldsGeneratorTest {
|
public class SdCardFieldsGeneratorTest {
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -4,7 +4,7 @@ import com.rusefi.ReaderStateImpl;
|
||||||
import com.rusefi.output.BaseCHeaderConsumer;
|
import com.rusefi.output.BaseCHeaderConsumer;
|
||||||
import com.rusefi.output.JavaFieldsConsumer;
|
import com.rusefi.output.JavaFieldsConsumer;
|
||||||
import com.rusefi.output.TSProjectConsumer;
|
import com.rusefi.output.TSProjectConsumer;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.rusefi.test;
|
package com.rusefi.test;
|
||||||
|
|
||||||
import com.rusefi.VariableRegistry;
|
import com.rusefi.VariableRegistry;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.StringReader;
|
import java.io.StringReader;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.rusefi.test;
|
package com.rusefi.test;
|
||||||
|
|
||||||
import com.rusefi.VariableRegistry;
|
import com.rusefi.VariableRegistry;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package com.rusefi;
|
package com.rusefi;
|
||||||
|
|
||||||
import com.rusefi.enum_reader.Value;
|
import com.rusefi.enum_reader.Value;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.function.Executable;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.StringReader;
|
import java.io.StringReader;
|
||||||
|
@ -11,8 +11,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static com.rusefi.EnumsReader.isKeyValueLine;
|
import static com.rusefi.EnumsReader.isKeyValueLine;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
public class EnumToStringTest {
|
public class EnumToStringTest {
|
||||||
public static EnumToString process(EnumsReader enumsReader) {
|
public static EnumToString process(EnumsReader enumsReader) {
|
||||||
|
@ -204,8 +203,9 @@ public class EnumToStringTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = IllegalStateException.class)
|
@Test
|
||||||
public void testWithInputOutOfOrder() throws IOException {
|
public void testWithInputOutOfOrder() throws IOException {
|
||||||
|
assertThrows(IllegalStateException.class, () -> {
|
||||||
final StringReader reader = new StringReader(
|
final StringReader reader = new StringReader(
|
||||||
"typedef enum {\n" +
|
"typedef enum {\n" +
|
||||||
"\tGPIO_UNASSIGNED = XXXX,\n" +
|
"\tGPIO_UNASSIGNED = XXXX,\n" +
|
||||||
|
@ -226,6 +226,8 @@ public class EnumToStringTest {
|
||||||
"\tGPIO_UNASSIGNED,\n" +
|
"\tGPIO_UNASSIGNED,\n" +
|
||||||
"}\n", java);
|
"}\n", java);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package com.rusefi.util.test;
|
package com.rusefi.util.test;
|
||||||
|
|
||||||
import com.rusefi.util.LazyFileImpl;
|
import com.rusefi.util.LazyFileImpl;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
public class LazyFileTest {
|
public class LazyFileTest {
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
package rusefi;
|
package rusefi;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
|
|
||||||
public class GccMapReaderTest {
|
public class GccMapReaderTest {
|
||||||
private static final String BSS = "bss";
|
private static final String BSS = "bss";
|
||||||
|
|
Loading…
Reference in New Issue