soo many cleanups

This commit is contained in:
Matthew Kennedy 2023-10-31 01:14:22 -07:00
parent e506b69f4a
commit 4364a9730e
6 changed files with 12 additions and 16 deletions

View File

@ -14,8 +14,7 @@ import java.util.Arrays;
import static com.rusefi.IoUtil.getEnableCommand;
import static com.rusefi.TestingUtils.assertNull;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.*;
/**
* rusEFI firmware simulator functional test suite
@ -333,7 +332,7 @@ public class CommonFunctionalTest extends RusefiTestBase {
assertWaveNull(msg, chart, EngineChart.TRIGGER_2);
sendComplexCommand("set " + "trigger_type" + " " + com.rusefi.enums.trigger_type_e.TT_FORD_ASPIRE.ordinal());
chart = nextChart();
assertTrue(chart.get(EngineChart.TRIGGER_2) != null);
assertNotNull(chart.get(EngineChart.TRIGGER_2));
}
@Test
@ -475,7 +474,7 @@ public class CommonFunctionalTest extends RusefiTestBase {
}
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) {

View File

@ -141,7 +141,7 @@ public class IniFileReaderTest {
byte[] expected = {'k', 0, 0, 0, 0, 0, 0};
assertTrue(Arrays.equals(expected, ProtocolCommand.parse(crcProtocol).getBytes()));
assertArrayEquals(expected, ProtocolCommand.parse(crcProtocol).getBytes());
}
@Test
@ -177,9 +177,9 @@ public class IniFileReaderTest {
assertEquals(0, EnumIniField.getBitRange(4, 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));
}

View File

@ -5,8 +5,7 @@ import org.junit.Test;
import java.util.Arrays;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.*;
/**
* Andrey Belomutskiy, (c) 2013-2020
@ -30,7 +29,6 @@ public class CRCTest {
byte[] command = {'S'};
byte[] expected = {0, 1, 0x53, 0x20, 0x60, -17, -61};
byte[] actual = IoHelper.makeCrc32Packet(command);
assertTrue(Arrays.toString(expected) + " vs " + Arrays.toString(actual),
Arrays.equals(expected, actual));
assertArrayEquals(Arrays.toString(expected) + " vs " + Arrays.toString(actual), expected, actual);
}
}

View File

@ -7,8 +7,7 @@ import org.junit.Test;
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicLong;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.*;
public class TimeBasedBufferTest {
@Test
@ -41,7 +40,7 @@ public class TimeBasedBufferTest {
b.add(3);
assertEquals(2, b.getSize()); // value for same timestamp is overriden
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);

View File

@ -110,7 +110,7 @@ public class ParseDefinitionsTest {
// Should get back the new definition, not the old one
Definition def2 = state.findDefinition("val");
Assert.assertTrue(def != def2);
Assert.assertNotSame(def, def2);
Assert.assertEquals(40, def2.asDouble(), 1e-5);
}

View File

@ -336,7 +336,7 @@ public class VariableRegistry {
}
@Nullable
public String get(Object key) {
public String get(String key) {
return data.get(key);
}
}