Commit 5e3bb53e authored by Bryan Cazabonne's avatar Bryan Cazabonne
Browse files

Improved test coverage.

parent 2990dae7
Pipeline #1088 passed with stages
in 27 minutes and 10 seconds
......@@ -197,7 +197,7 @@ public class BeidouPropagatorTest {
public void testIssue544() {
// Builds the BeidouPropagator from the almanac
final GNSSPropagator propagator = new GNSSPropagatorBuilder(almanac).build();
// In order to test the issue, we volontary set a Double.NaN value in the date.
// In order to test the issue, we voluntary set a Double.NaN value in the date.
final AbsoluteDate date0 = new AbsoluteDate(2010, 5, 7, 7, 50, Double.NaN, TimeScalesFactory.getUTC());
final PVCoordinates pv0 = propagator.propagateInEcef(date0);
// Verify that an infinite loop did not occur
......
......@@ -41,6 +41,7 @@ import org.orekit.time.TimeComponents;
import org.orekit.time.TimeScalesFactory;
import org.orekit.utils.CartesianDerivativesFilter;
import org.orekit.utils.Constants;
import org.orekit.utils.IERSConventions;
import org.orekit.utils.PVCoordinates;
import org.orekit.utils.TimeStampedPVCoordinates;
......@@ -66,7 +67,12 @@ public class GLONASSAnalyticalPropagatorTest {
@Test
public void testPerfectValues() {
// Build the propagator
final GLONASSAnalyticalPropagator propagator = new GLONASSAnalyticalPropagatorBuilder(almanac).build();
final GLONASSAnalyticalPropagator propagator = new GLONASSAnalyticalPropagatorBuilder(almanac).
attitudeProvider(Propagator.DEFAULT_LAW).
mass(1521.0).
eci(FramesFactory.getEME2000()).
ecef(FramesFactory.getITRF(IERSConventions.IERS_2010, false)).
build();
// Target
final AbsoluteDate target = new AbsoluteDate(new DateComponents(2007, 12, 23),
......@@ -91,7 +97,7 @@ public class GLONASSAnalyticalPropagatorTest {
-3249.98587740305799));
// Check
Assert.assertEquals(Propagator.DEFAULT_MASS, propagator.getMass(target), 0.1);
Assert.assertEquals(1521.0, propagator.getMass(target), 0.1);
Assert.assertEquals(0.0, pvFinal.getPosition().distance(pvExpected.getPosition()), 1.1e-7);
Assert.assertEquals(0.0, pvFinal.getVelocity().distance(pvExpected.getVelocity()), 1.1e-5);
......
......@@ -34,6 +34,7 @@ import org.orekit.frames.Frame;
import org.orekit.frames.FramesFactory;
import org.orekit.gnss.SEMParser;
import org.orekit.gnss.SatelliteSystem;
import org.orekit.propagation.Propagator;
import org.orekit.propagation.SpacecraftState;
import org.orekit.propagation.analytical.gnss.data.GNSSOrbitalElements;
import org.orekit.propagation.analytical.gnss.data.GPSAlmanac;
......@@ -84,6 +85,7 @@ public class GPSPropagatorTest {
dtRelMax = FastMath.max(dtRelMax, corrections[1]);
Assert.assertEquals(0.0, corrections[2], Precision.SAFE_MIN);
}
Assert.assertEquals(0.0, almanacs.get(0).getToc(), 1.0e-12);
Assert.assertEquals(-1.1679e-8, dtRelMin, 1.0e-12);
Assert.assertEquals(+1.1679e-8, dtRelMax, 1.0e-12);
}
......@@ -91,7 +93,12 @@ public class GPSPropagatorTest {
@Test
public void testGPSCycle() {
// Builds the GPSPropagator from the almanac
final GNSSPropagator propagator = new GNSSPropagatorBuilder(almanacs.get(0)).build();
final GNSSPropagator propagator = new GNSSPropagatorBuilder(almanacs.get(0)).
attitudeProvider(Propagator.DEFAULT_LAW).
mass(1521.0).
eci(FramesFactory.getEME2000()).
ecef(FramesFactory.getITRF(IERSConventions.IERS_2010, false)).
build();
// Propagate at the GPS date and one GPS cycle later
final AbsoluteDate date0 = almanacs.get(0).getDate();
final Vector3D p0 = propagator.propagateInEcef(date0).getPosition();
......@@ -337,7 +344,7 @@ public class GPSPropagatorTest {
public void testIssue544() {
// Builds the GPSPropagator from the almanac
final GNSSPropagator propagator = new GNSSPropagatorBuilder(almanacs.get(0)).build();
// In order to test the issue, we volontary set a Double.NaN value in the date.
// In order to test the issue, we voluntary set a Double.NaN value in the date.
final AbsoluteDate date0 = new AbsoluteDate(2010, 5, 7, 7, 50, Double.NaN, TimeScalesFactory.getUTC());
final PVCoordinates pv0 = propagator.propagateInEcef(date0);
// Verify that an infinite loop did not occur
......
......@@ -208,7 +208,7 @@ public class GalileoPropagatorTest {
public void testIssue544() {
// Builds the GalileoPropagator from the almanac
final GNSSPropagator propagator = new GNSSPropagatorBuilder(goe).build();
// In order to test the issue, we volontary set a Double.NaN value in the date.
// In order to test the issue, we voluntary set a Double.NaN value in the date.
final AbsoluteDate date0 = new AbsoluteDate(2010, 5, 7, 7, 50, Double.NaN, TimeScalesFactory.getUTC());
final PVCoordinates pv0 = propagator.propagateInEcef(date0);
// Verify that an infinite loop did not occur
......
......@@ -158,7 +158,7 @@ public class IRNSSPropagatorTest {
public void testIssue544() {
// Builds the IRNSSPropagator from the almanac
final GNSSPropagator propagator = new GNSSPropagatorBuilder(almanac, frames).build();
// In order to test the issue, we volontary set a Double.NaN value in the date.
// In order to test the issue, we voluntary set a Double.NaN value in the date.
final AbsoluteDate date0 = new AbsoluteDate(2010, 5, 7, 7, 50, Double.NaN, TimeScalesFactory.getUTC());
final PVCoordinates pv0 = propagator.propagateInEcef(date0);
// Verify that an infinite loop did not occur
......
......@@ -193,7 +193,7 @@ public class QZSSPropagatorTest {
public void testIssue544() {
// Builds the QZSSPropagator from the almanac
final GNSSPropagator propagator = new GNSSPropagatorBuilder(almanac).build();
// In order to test the issue, we volontary set a Double.NaN value in the date.
// In order to test the issue, we voluntary set a Double.NaN value in the date.
final AbsoluteDate date0 = new AbsoluteDate(2010, 5, 7, 7, 50, Double.NaN, TimeScalesFactory.getUTC());
final PVCoordinates pv0 = propagator.propagateInEcef(date0);
// Verify that an infinite loop did not occur
......
......@@ -33,6 +33,7 @@ import org.orekit.Utils;
import org.orekit.frames.Frame;
import org.orekit.frames.FramesFactory;
import org.orekit.frames.ITRFVersion;
import org.orekit.propagation.Propagator;
import org.orekit.propagation.SpacecraftState;
import org.orekit.propagation.analytical.gnss.data.GLONASSEphemeris;
import org.orekit.propagation.analytical.gnss.data.GLONASSNavigationMessage;
......@@ -72,7 +73,11 @@ public class GLONASSNumericalPropagatorTest {
final ClassicalRungeKuttaIntegrator integrator = new ClassicalRungeKuttaIntegrator(10.);
// Initialize the propagator
final GLONASSNumericalPropagator propagator = new GLONASSNumericalPropagatorBuilder(integrator, ephemeris, false).build();
final GLONASSNumericalPropagator propagator = new GLONASSNumericalPropagatorBuilder(integrator, ephemeris, false).
attitudeProvider(Propagator.DEFAULT_LAW).
mass(1521.0).
eci(FramesFactory.getEME2000()).
build();
// Target date
final AbsoluteDate target = new AbsoluteDate(new DateComponents(2012, 9, 7),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment