From 923294ed1f48946c673136512b8b9164a580033f Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Thu, 27 Aug 2020 20:35:15 +0200 Subject: [PATCH] Add ticksDelivered to PodInfoFaultEventTest --- .../message/response/podinfo/PodInfoFaultEvent.java | 4 +--- .../message/response/podinfo/PodInfoFaultEventTest.java | 5 ++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/message/response/podinfo/PodInfoFaultEvent.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/message/response/podinfo/PodInfoFaultEvent.java index 751a6d16e0..d099894ab6 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/message/response/podinfo/PodInfoFaultEvent.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/message/response/podinfo/PodInfoFaultEvent.java @@ -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) + '}'; } } diff --git a/omnipod/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/message/response/podinfo/PodInfoFaultEventTest.java b/omnipod/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/message/response/podinfo/PodInfoFaultEventTest.java index e462761eb6..5731123724 100644 --- a/omnipod/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/message/response/podinfo/PodInfoFaultEventTest.java +++ b/omnipod/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/message/response/podinfo/PodInfoFaultEventTest.java @@ -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());