mirror of https://github.com/rusefi/rusefi-1.git
progress
This commit is contained in:
parent
f8b6378e94
commit
42a69be638
|
@ -1,29 +1,16 @@
|
||||||
package com.rusefi.core.test;
|
package com.rusefi.core.test;
|
||||||
|
|
||||||
import com.rusefi.core.SensorCentral;
|
|
||||||
import com.rusefi.core.EngineState;
|
import com.rusefi.core.EngineState;
|
||||||
import com.rusefi.io.LinkDecoder;
|
|
||||||
import org.junit.Ignore;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import static junit.framework.Assert.assertFalse;
|
||||||
|
import static junit.framework.Assert.assertTrue;
|
||||||
import static com.rusefi.core.EngineState.SEPARATOR;
|
|
||||||
import static junit.framework.Assert.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Andrey Belomutskiy
|
* @author Andrey Belomutskiy
|
||||||
* 12/26/12
|
* 12/26/12
|
||||||
*/
|
*/
|
||||||
public class EngineStateTest {
|
public class EngineStateTest {
|
||||||
@Test
|
|
||||||
public void packUnpack() {
|
|
||||||
String a = "rpm,100,";
|
|
||||||
String packed = EngineState.packString(a);
|
|
||||||
assertEquals("line:8:rpm,100,", packed);
|
|
||||||
assertEquals(a, LinkDecoder.TEXT_PROTOCOL_DECODER.unpack(packed));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void startsWithIgnoreCase() {
|
public void startsWithIgnoreCase() {
|
||||||
assertTrue(EngineState.startWithIgnoreCase("HELLO", "he"));
|
assertTrue(EngineState.startWithIgnoreCase("HELLO", "he"));
|
||||||
|
|
|
@ -7,19 +7,9 @@ import com.rusefi.core.EngineState;
|
||||||
* 6/20/2015.
|
* 6/20/2015.
|
||||||
*/
|
*/
|
||||||
public interface LinkDecoder {
|
public interface LinkDecoder {
|
||||||
LinkDecoder TEXT_PROTOCOL_DECODER = new LinkDecoder() {
|
LinkDecoder VOID = new LinkDecoder() {};
|
||||||
@Override
|
|
||||||
public String unpack(String packet) {
|
|
||||||
return EngineState.unpackString(packet);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
LinkDecoder VOID = new LinkDecoder() {
|
default String unpack(String packet) {
|
||||||
@Override
|
return packet;
|
||||||
public String unpack(String packet) {
|
}
|
||||||
return packet;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
String unpack(String packet);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue