Add ticksDelivered to PodInfoFaultEventTest

This commit is contained in:
Bart Sopers 2020-08-27 20:35:15 +02:00
parent ff72b0d474
commit 923294ed1f
2 changed files with 5 additions and 4 deletions

View file

@ -2,8 +2,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.mes
import org.joda.time.Duration;
import java.util.Arrays;
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusUpdatableResponse;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertSet;
@ -175,7 +173,7 @@ public class PodInfoFaultEvent extends PodInfo implements StatusUpdatableRespons
", receiverLowGain=" + receiverLowGain +
", radioRSSI=" + radioRSSI +
", podProgressStatusAtTimeOfFirstLoggedFaultEvent=" + podProgressStatusAtTimeOfFirstLoggedFaultEvent +
", unknownValue=" + Arrays.toString(unknownValue) +
", unknownValue=" + ByteUtil.shortHexString(unknownValue) +
'}';
}
}

View file

@ -62,6 +62,7 @@ public class PodInfoFaultEventTest {
assertEquals(PodProgressStatus.FAULT_EVENT_OCCURRED, podInfoFaultEvent.getPodProgressStatus());
assertEquals(DeliveryStatus.SUSPENDED, podInfoFaultEvent.getDeliveryStatus());
assertEquals(2034, podInfoFaultEvent.getTicksDelivered());
assertEquals(101.7, podInfoFaultEvent.getInsulinDelivered(), 0.000001);
assertEquals(0, podInfoFaultEvent.getBolusNotDelivered(), 0.000001);
assertEquals(0x04, podInfoFaultEvent.getPodMessageCounter());
@ -82,6 +83,7 @@ public class PodInfoFaultEventTest {
assertEquals(PodProgressStatus.INACTIVE, podInfoFaultEvent.getPodProgressStatus());
assertEquals(DeliveryStatus.SUSPENDED, podInfoFaultEvent.getDeliveryStatus());
assertEquals(236, podInfoFaultEvent.getTicksDelivered());
assertEquals(11.8, podInfoFaultEvent.getInsulinDelivered(), 0.000001);
assertEquals(0.05, podInfoFaultEvent.getBolusNotDelivered(), 0.000001);
assertEquals(0x02, podInfoFaultEvent.getPodMessageCounter());
@ -97,11 +99,12 @@ public class PodInfoFaultEventTest {
}
@Test
public void testPodInfoFaultEventMaxInsulinNotDelivered() {
public void testPodInfoFaultEventMaxBolusNotDelivered() {
PodInfoFaultEvent podInfoFaultEvent = new PodInfoFaultEvent(ByteUtil.fromHexString("020f00ffff0200ec6a026803ff026b000028a7082023"));
assertEquals(PodProgressStatus.INACTIVE, podInfoFaultEvent.getPodProgressStatus());
assertEquals(DeliveryStatus.SUSPENDED, podInfoFaultEvent.getDeliveryStatus());
assertEquals(236, podInfoFaultEvent.getTicksDelivered());
assertEquals(11.8, podInfoFaultEvent.getInsulinDelivered(), 0.000001);
assertEquals(3276.75, podInfoFaultEvent.getBolusNotDelivered(), 0.000001); // Insane and will not happen, but this verifies that we convert it to an unsigned int
assertEquals(0x02, podInfoFaultEvent.getPodMessageCounter());