From a916871596a8413923efeb168a43ed2a0e79b45d Mon Sep 17 00:00:00 2001 From: andrekir Date: Sun, 8 Sep 2024 08:33:39 -0300 Subject: [PATCH] chore: remove `MeshServiceTest` --- .../geeksville/mesh/service/MeshService.kt | 6 +---- .../mesh/service/MeshServiceTest.kt | 24 ------------------- 2 files changed, 1 insertion(+), 29 deletions(-) delete mode 100644 app/src/test/java/com/geeksville/mesh/service/MeshServiceTest.kt diff --git a/app/src/main/java/com/geeksville/mesh/service/MeshService.kt b/app/src/main/java/com/geeksville/mesh/service/MeshService.kt index 2149bc2a..190debcc 100644 --- a/app/src/main/java/com/geeksville/mesh/service/MeshService.kt +++ b/app/src/main/java/com/geeksville/mesh/service/MeshService.kt @@ -1053,7 +1053,7 @@ class MeshService : Service(), Logging { val rxTime = if (packet.rxTime != 0) packet.rxTime else currentSecond() // Update our last seen based on any valid timestamps. If the device didn't provide a timestamp make one - updateNodeInfoTime(it, rxTime) + it.lastHeard = rxTime it.snr = packet.rxSnr it.rssi = packet.rxRssi @@ -1997,7 +1997,3 @@ class MeshService : Service(), Logging { } } } - -fun updateNodeInfoTime(it: NodeInfo, rxTime: Int) { - it.lastHeard = rxTime -} diff --git a/app/src/test/java/com/geeksville/mesh/service/MeshServiceTest.kt b/app/src/test/java/com/geeksville/mesh/service/MeshServiceTest.kt deleted file mode 100644 index 40bd2c1c..00000000 --- a/app/src/test/java/com/geeksville/mesh/service/MeshServiceTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.geeksville.mesh.service - -import com.geeksville.mesh.MeshProtos -import com.geeksville.mesh.MeshUser -import com.geeksville.mesh.NodeInfo -import com.geeksville.mesh.Position -import org.junit.Assert -import org.junit.Test - - -class MeshServiceTest { - val model = MeshProtos.HardwareModel.ANDROID_SIM - val nodeInfo = NodeInfo(4, MeshUser("+one", "User One", "U1", model), Position(37.1, 121.1, 35, 10)) - - @Test - fun givenNodeInfo_whenUpdatingWithNewTime_thenPositionTimeIsUpdated() { - - val newerTime = 20 - updateNodeInfoTime(nodeInfo, newerTime) - Assert.assertEquals(newerTime, nodeInfo.lastHeard) - } -} - -