Less warnings. Changed a priority queue test to check if updating an element and removing it works.

This commit is contained in:
Didier Le Botlan
2025-03-28 09:28:14 +01:00
parent 443539a6ba
commit 375e783c42
5 changed files with 15 additions and 2 deletions

View File

@@ -26,6 +26,7 @@ public class BinaryPathReader extends BinaryReader implements PathReader {
super(MAGIC_NUMBER, VERSION, dis);
}
@SuppressWarnings("deprecation")
@Override
public Path readPath(Graph graph) throws IOException {

View File

@@ -110,6 +110,7 @@ public class PathTest {
assertEquals(10, longLoopPath.size());
}
@SuppressWarnings("deprecation")
@Test
public void testIsValid() {
assertTrue(emptyPath.isValid());
@@ -122,6 +123,7 @@ public class PathTest {
assertFalse(invalidPath.isValid());
}
@SuppressWarnings("deprecation")
@Test
public void testGetLength() {
assertEquals(0, emptyPath.getLength(), 1e-6);
@@ -132,6 +134,7 @@ public class PathTest {
assertEquals(120, longLoopPath.getLength(), 1e-6);
}
@SuppressWarnings("deprecation")
@Test
public void testGetTravelTime() {
// Note: 18 km/h = 5m/s
@@ -151,6 +154,7 @@ public class PathTest {
assertEquals(15, longLoopPath.getTravelTime(28.8), 1e-6);
}
@SuppressWarnings("deprecation")
@Test
public void testGetMinimumTravelTime() {
assertEquals(0, emptyPath.getMinimumTravelTime(), 1e-4);
@@ -161,6 +165,7 @@ public class PathTest {
assertEquals(11.25, longLoopPath.getMinimumTravelTime(), 1e-4);
}
@SuppressWarnings("deprecation")
@Test
public void testCreateFastestPathFromNodes() {
Path path;
@@ -197,6 +202,7 @@ public class PathTest {
assertTrue(path.isEmpty());
}
@SuppressWarnings("deprecation")
@Test
public void testCreateShortestPathFromNodes() {
Path path;
@@ -233,12 +239,14 @@ public class PathTest {
assertTrue(path.isEmpty());
}
@SuppressWarnings("deprecation")
@Test(expected = IllegalArgumentException.class)
public void testCreateFastestPathFromNodesException() {
Path.createFastestPathFromNodes(graph,
Arrays.asList(new Node[] { nodes[1], nodes[0] }));
}
@SuppressWarnings("deprecation")
@Test(expected = IllegalArgumentException.class)
public void testCreateShortestPathFromNodesException() {
Path.createShortestPathFromNodes(graph,