mirror of https://github.com/FOME-Tech/fome-fw.git
soo many cleanups
This commit is contained in:
parent
e506b69f4a
commit
4364a9730e
|
@ -14,8 +14,7 @@ import java.util.Arrays;
|
||||||
|
|
||||||
import static com.rusefi.IoUtil.getEnableCommand;
|
import static com.rusefi.IoUtil.getEnableCommand;
|
||||||
import static com.rusefi.TestingUtils.assertNull;
|
import static com.rusefi.TestingUtils.assertNull;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.*;
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* rusEFI firmware simulator functional test suite
|
* rusEFI firmware simulator functional test suite
|
||||||
|
@ -333,7 +332,7 @@ public class CommonFunctionalTest extends RusefiTestBase {
|
||||||
assertWaveNull(msg, chart, EngineChart.TRIGGER_2);
|
assertWaveNull(msg, chart, EngineChart.TRIGGER_2);
|
||||||
sendComplexCommand("set " + "trigger_type" + " " + com.rusefi.enums.trigger_type_e.TT_FORD_ASPIRE.ordinal());
|
sendComplexCommand("set " + "trigger_type" + " " + com.rusefi.enums.trigger_type_e.TT_FORD_ASPIRE.ordinal());
|
||||||
chart = nextChart();
|
chart = nextChart();
|
||||||
assertTrue(chart.get(EngineChart.TRIGGER_2) != null);
|
assertNotNull(chart.get(EngineChart.TRIGGER_2));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -475,7 +474,7 @@ public class CommonFunctionalTest extends RusefiTestBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void assertWaveNotNull(String msg, EngineChart chart, String key) {
|
private static void assertWaveNotNull(String msg, EngineChart chart, String key) {
|
||||||
assertTrue(msg, chart.get(key) != null);
|
assertNotNull(msg, chart.get(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void assertWaveNotNull(EngineChart chart, String... keys) {
|
private static void assertWaveNotNull(EngineChart chart, String... keys) {
|
||||||
|
|
|
@ -141,7 +141,7 @@ public class IniFileReaderTest {
|
||||||
|
|
||||||
byte[] expected = {'k', 0, 0, 0, 0, 0, 0};
|
byte[] expected = {'k', 0, 0, 0, 0, 0, 0};
|
||||||
|
|
||||||
assertTrue(Arrays.equals(expected, ProtocolCommand.parse(crcProtocol).getBytes()));
|
assertArrayEquals(expected, ProtocolCommand.parse(crcProtocol).getBytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -177,9 +177,9 @@ public class IniFileReaderTest {
|
||||||
assertEquals(0, EnumIniField.getBitRange(4, 0, 2));
|
assertEquals(0, EnumIniField.getBitRange(4, 0, 2));
|
||||||
assertEquals(3, EnumIniField.getBitRange(7, 0, 2));
|
assertEquals(3, EnumIniField.getBitRange(7, 0, 2));
|
||||||
|
|
||||||
assertEquals(true, EnumIniField.getBit(0xff, 0));
|
assertTrue(EnumIniField.getBit(0xff, 0));
|
||||||
|
|
||||||
assertEquals(true, EnumIniField.getBit(0xf0, 4));
|
assertTrue(EnumIniField.getBit(0xf0, 4));
|
||||||
assertEquals(2, EnumIniField.getBitRange(0xf0, 3, 2));
|
assertEquals(2, EnumIniField.getBitRange(0xf0, 3, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,7 @@ import org.junit.Test;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.*;
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Andrey Belomutskiy, (c) 2013-2020
|
* Andrey Belomutskiy, (c) 2013-2020
|
||||||
|
@ -30,7 +29,6 @@ public class CRCTest {
|
||||||
byte[] command = {'S'};
|
byte[] command = {'S'};
|
||||||
byte[] expected = {0, 1, 0x53, 0x20, 0x60, -17, -61};
|
byte[] expected = {0, 1, 0x53, 0x20, 0x60, -17, -61};
|
||||||
byte[] actual = IoHelper.makeCrc32Packet(command);
|
byte[] actual = IoHelper.makeCrc32Packet(command);
|
||||||
assertTrue(Arrays.toString(expected) + " vs " + Arrays.toString(actual),
|
assertArrayEquals(Arrays.toString(expected) + " vs " + Arrays.toString(actual), expected, actual);
|
||||||
Arrays.equals(expected, actual));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,8 +7,7 @@ import org.junit.Test;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.*;
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
public class TimeBasedBufferTest {
|
public class TimeBasedBufferTest {
|
||||||
@Test
|
@Test
|
||||||
|
@ -41,7 +40,7 @@ public class TimeBasedBufferTest {
|
||||||
b.add(3);
|
b.add(3);
|
||||||
assertEquals(2, b.getSize()); // value for same timestamp is overriden
|
assertEquals(2, b.getSize()); // value for same timestamp is overriden
|
||||||
double[] v = b.getValues();
|
double[] v = b.getValues();
|
||||||
assertTrue(Arrays.equals(new double[]{2, 3}, v));
|
assertArrayEquals(new double[]{2, 3}, v, 0.0);
|
||||||
|
|
||||||
assertEquals(0.707106, DataBuffer.getStandardDeviation(b.getValues()), 0.001);
|
assertEquals(0.707106, DataBuffer.getStandardDeviation(b.getValues()), 0.001);
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ public class ParseDefinitionsTest {
|
||||||
|
|
||||||
// Should get back the new definition, not the old one
|
// Should get back the new definition, not the old one
|
||||||
Definition def2 = state.findDefinition("val");
|
Definition def2 = state.findDefinition("val");
|
||||||
Assert.assertTrue(def != def2);
|
Assert.assertNotSame(def, def2);
|
||||||
Assert.assertEquals(40, def2.asDouble(), 1e-5);
|
Assert.assertEquals(40, def2.asDouble(), 1e-5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -336,7 +336,7 @@ public class VariableRegistry {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public String get(Object key) {
|
public String get(String key) {
|
||||||
return data.get(key);
|
return data.get(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue