- big refactor for scheduler.

This commit is contained in:
gazebo
2018-07-25 20:43:41 +08:00
parent f3df85c8e0
commit c0770e9ab5
16 changed files with 515 additions and 321 deletions

View File

@@ -11,3 +11,20 @@ func TestEarthDistance(t *testing.T) {
distance := EarthDistance(lat1, lng1, lat2, lng2)
fmt.Print(distance)
}
func TestMapValue2Scope(t *testing.T) {
result := MapValue2Scope(-4, -10, 0, 0, 100)
if result != 60 {
t.Fatalf("result:%d is wrong", result)
}
result = MapValue2Scope(-4, 0, 10, 0, 100)
if result != 0 {
t.Fatalf("result:%d is wrong", result)
}
result = MapValue2Scope(100, 0, 10, 0, 100)
if result != 100 {
t.Fatalf("result:%d is wrong", result)
}
}