Skip to content
Snippets Groups Projects
Commit eb59f4d0 authored by Guylaine Prat's avatar Guylaine Prat
Browse files

Improve tests coverage

parent a3a10418
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@ package org.orekit.rugged.api;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.io.File;
......@@ -1479,6 +1480,34 @@ public class RuggedTest {
assertEquals(sp.getPixelNumber(), spChangeLines.getPixelNumber(), 1.e-9);
assertEquals(sp.getLineNumber(), spChangeLines.getLineNumber(), 1.e-9);
// For computeInverseLocOnGridWithoutAtmosphere special cases
try {
java.lang.reflect.Method computeWithoutAtmosphere =
rugged.getClass().getDeclaredMethod("computeInverseLocOnGridWithoutAtmosphere",
GeodeticPoint[][].class,
Integer.TYPE, Integer.TYPE,
LineSensor.class, Integer.TYPE, Integer.TYPE);
computeWithoutAtmosphere.setAccessible(true);
final int nbPixelGrid = 2;
final int nbLineGrid = 2;
GeodeticPoint[][] groundGridWithAtmosphere = new GeodeticPoint[nbPixelGrid][nbLineGrid];
for (int i = 0; i < nbPixelGrid; i++) {
for (int j = 0; j < nbLineGrid; j++) {
groundGridWithAtmosphere[i][j] = null;
}
}
SensorPixel[][] spNull = (SensorPixel[][]) computeWithoutAtmosphere.invoke(rugged, groundGridWithAtmosphere, nbPixelGrid, nbLineGrid, lineSensor, minLine, maxLine);
for (int i = 0; i < nbPixelGrid; i++) {
for (int j = 0; j < nbLineGrid; j++) {
assertNull(spNull[i][j]);
}
}
} catch (NoSuchMethodException | SecurityException |
IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
Assert.fail(e.getLocalizedMessage());
}
}
......
......@@ -16,13 +16,17 @@
*/
package org.orekit.rugged.intersection.duvenhage;
import java.lang.reflect.Field;
import org.hipparchus.random.RandomGenerator;
import org.hipparchus.random.Well1024a;
import org.hipparchus.util.FastMath;
import java.io.IOException;
import java.lang.reflect.Field;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
public class MinMaxTreeTileTest {
......@@ -264,6 +268,17 @@ public class MinMaxTreeTileTest {
}
}
@Test
public void testForCoverage() throws IOException {
org.orekit.rugged.errors.DumpManager.activate(tempFolder.newFile());
MinMaxTreeTile tile = createTile(1201, 1201);
tile.getMinElevation(100, 100, 0);
org.orekit.rugged.errors.DumpManager.deactivate();
}
private int[] neighbors(int row, int column, int nbRows, int nbColumns, int stages) {
// poor man identification of neighbors cells merged together with specified cell
......@@ -345,5 +360,8 @@ public class MinMaxTreeTileTest {
tile.tileUpdateCompleted();
return tile;
}
@Rule
public TemporaryFolder tempFolder = new TemporaryFolder();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment