Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

Commit

Permalink
More test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherRabotin committed Jan 30, 2017
1 parent e3e29b2 commit 5bd8e35
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
14 changes: 14 additions & 0 deletions celestial_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@ import (
func TestCelestialObject(t *testing.T) {
for _, object := range []CelestialObject{Sun, Earth, Mars} {
object.HelioOrbit(time.Now().UTC())
var i uint8
for i = 1; i < 6; i++ {
if i == 2 && object.J(i) != object.J2 {
t.Fatalf("J2 not returned for %s", object)
} else if i == 3 && object.J(i) != object.J3 {
t.Fatalf("J3 not returned for %s", object)
} else if i == 4 && object.J(i) != object.J4 {
t.Fatalf("J4 not returned for %s", object)
} else if (i < 2 || i > 4) && object.J(i) != 0 {
t.Fatalf("J(%d) = %f != 0 for %s", i, object.J(i), object)
} else {
t.Logf("[OK] J(%d) %s", i, object)
}
}
}
}

Expand Down
6 changes: 6 additions & 0 deletions mission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,3 +584,9 @@ func TestPetropoulosCaseE(t *testing.T) {
}
}
}

func TestPropagators(t *testing.T) {
for _, meth := range []Propagator{GaussianVOP, Cartesian} {
t.Logf("[OK] %s", meth)
}
}

0 comments on commit 5bd8e35

Please sign in to comment.