kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
chore: remove `MeshServiceTest`
rodzic
8be6d74ed8
commit
a916871596
|
@ -1053,7 +1053,7 @@ class MeshService : Service(), Logging {
|
||||||
val rxTime = if (packet.rxTime != 0) packet.rxTime else currentSecond()
|
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
|
// 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.snr = packet.rxSnr
|
||||||
it.rssi = packet.rxRssi
|
it.rssi = packet.rxRssi
|
||||||
|
|
||||||
|
@ -1997,7 +1997,3 @@ class MeshService : Service(), Logging {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateNodeInfoTime(it: NodeInfo, rxTime: Int) {
|
|
||||||
it.lastHeard = rxTime
|
|
||||||
}
|
|
||||||
|
|
|
@ -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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue