mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Don't crash the app if the node sends a bogus lat > 90 deg
This commit is contained in:
parent
1bff4d8178
commit
12ef3d4d7b
2 changed files with 23 additions and 1 deletions
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)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue