mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-31 20:21:36 -04:00
Don't crash the app if the node sends a bogus lat > 90 deg
This commit is contained in:
18
app/src/test/java/com/geeksville/mesh/PositionTest.kt
Normal file
18
app/src/test/java/com/geeksville/mesh/PositionTest.kt
Normal file
@@ -0,0 +1,18 @@
|
||||
package com.geeksville.mesh
|
||||
|
||||
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
|
||||
class PositionTest {
|
||||
@Test
|
||||
fun degGood() {
|
||||
Assert.assertEquals(Position.degI(89.0), 890000000)
|
||||
Assert.assertEquals(Position.degI(-89.0), -890000000)
|
||||
|
||||
Assert.assertEquals(Position.degD(Position.degI(89.0)), 89.0, 0.01)
|
||||
Assert.assertEquals(Position.degD(Position.degI(-89.0)), -89.0, 0.01)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user