also dead
This commit is contained in:
parent
3985c05998
commit
3034ffda96
|
@ -3,6 +3,7 @@ package com.rusefi.core.test;
|
||||||
import com.rusefi.core.SensorCentral;
|
import com.rusefi.core.SensorCentral;
|
||||||
import com.rusefi.core.EngineState;
|
import com.rusefi.core.EngineState;
|
||||||
import com.rusefi.io.LinkDecoder;
|
import com.rusefi.io.LinkDecoder;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
@ -29,20 +30,4 @@ public class EngineStateTest {
|
||||||
assertFalse(EngineState.startWithIgnoreCase("HELLO", "hellllll"));
|
assertFalse(EngineState.startWithIgnoreCase("HELLO", "hellllll"));
|
||||||
assertFalse(EngineState.startWithIgnoreCase("HELLO", "ha"));
|
assertFalse(EngineState.startWithIgnoreCase("HELLO", "ha"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testRpm() {
|
|
||||||
final AtomicInteger rpmResult = new AtomicInteger();
|
|
||||||
EngineState es = new EngineState(new EngineState.EngineStateListenerImpl() {
|
|
||||||
public void onKeyValue(String key, String value) {
|
|
||||||
if ("rpm".equals(key))
|
|
||||||
rpmResult.set(Integer.parseInt(value));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
es.processNewData("line:7:", LinkDecoder.TEXT_PROTOCOL_DECODER);
|
|
||||||
es.processNewData(SensorCentral.RPM_KEY + SEPARATOR, LinkDecoder.TEXT_PROTOCOL_DECODER);
|
|
||||||
assertEquals(0, rpmResult.get());
|
|
||||||
es.processNewData("600\r", LinkDecoder.TEXT_PROTOCOL_DECODER);
|
|
||||||
assertEquals(600, rpmResult.get());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue