progress
This commit is contained in:
parent
1cf4ae66d4
commit
c63afbb7e3
|
@ -1,29 +1,16 @@
|
|||
package com.rusefi.core.test;
|
||||
|
||||
import com.rusefi.core.SensorCentral;
|
||||
import com.rusefi.core.EngineState;
|
||||
import com.rusefi.io.LinkDecoder;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import static com.rusefi.core.EngineState.SEPARATOR;
|
||||
import static junit.framework.Assert.*;
|
||||
import static junit.framework.Assert.assertFalse;
|
||||
import static junit.framework.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* @author Andrey Belomutskiy
|
||||
* 12/26/12
|
||||
*/
|
||||
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
|
||||
public void startsWithIgnoreCase() {
|
||||
assertTrue(EngineState.startWithIgnoreCase("HELLO", "he"));
|
||||
|
|
|
@ -7,19 +7,9 @@ import com.rusefi.core.EngineState;
|
|||
* 6/20/2015.
|
||||
*/
|
||||
public interface LinkDecoder {
|
||||
LinkDecoder TEXT_PROTOCOL_DECODER = new LinkDecoder() {
|
||||
@Override
|
||||
public String unpack(String packet) {
|
||||
return EngineState.unpackString(packet);
|
||||
}
|
||||
};
|
||||
LinkDecoder VOID = new LinkDecoder() {};
|
||||
|
||||
LinkDecoder VOID = new LinkDecoder() {
|
||||
@Override
|
||||
public String unpack(String packet) {
|
||||
default String unpack(String packet) {
|
||||
return packet;
|
||||
}
|
||||
};
|
||||
|
||||
String unpack(String packet);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue