Less warnings. Changed a priority queue test to check if updating an element and removing it works.
This commit is contained in:
@@ -83,6 +83,8 @@ public abstract class PriorityQueueTest {
|
||||
public final E[] data;
|
||||
public final int[] deleteOrder;
|
||||
|
||||
// data contains values
|
||||
// deleteOrder contains indexes in data[]
|
||||
public TestParameters(E[] data, int[] deleteOrder) {
|
||||
this.data = data;
|
||||
this.deleteOrder = deleteOrder;
|
||||
@@ -309,9 +311,10 @@ public abstract class PriorityQueueTest {
|
||||
Assume.assumeFalse(queue.isEmpty());
|
||||
int min = Collections.min(Arrays.asList(parameters.data)).get();
|
||||
for (MutableInteger mi : parameters.data) {
|
||||
// Update value before removing it. This is what happens when updating a Dijkstra label before updating it.
|
||||
mi.set(--min);
|
||||
queue.remove(mi);
|
||||
assertEquals(parameters.data.length - 1, queue.size());
|
||||
mi.set(--min);
|
||||
queue.insert(mi);
|
||||
assertEquals(parameters.data.length, queue.size());
|
||||
assertEquals(min, queue.findMin().get());
|
||||
|
Reference in New Issue
Block a user