Added more test cases
This commit is contained in:
parent
e8331864ab
commit
ac18c2d522
1 changed files with 17 additions and 18 deletions
|
@ -27,7 +27,7 @@ public abstract class AlgoTest {
|
|||
protected ArrayList<PathDataset> invalidTestData;
|
||||
|
||||
// Graphs to use
|
||||
private Graph graphInsa, graphSquare, graphBretagne;
|
||||
private Graph graphInsa, graphSquare, graphBretagne, graphGuadeloupe;
|
||||
|
||||
/**
|
||||
* Class used to store all data related to a path and its computed solutions
|
||||
|
@ -129,6 +129,7 @@ public abstract class AlgoTest {
|
|||
graphInsa = readGraph("../Maps/insa.mapgr");
|
||||
graphSquare = readGraph("../Maps/carre.mapgr");
|
||||
graphBretagne = readGraph("../Maps/bretagne.mapgr");
|
||||
graphGuadeloupe = readGraph("../Maps/guadeloupe.mapgr");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -139,20 +140,23 @@ public abstract class AlgoTest {
|
|||
filterTime = ArcInspectorFactory.getAllFilters().get(2);
|
||||
}
|
||||
|
||||
private PathDataset getNewPathDataset(Graph graph, int originID, int destinationID) {
|
||||
return new PathDataset(
|
||||
graph,
|
||||
graph.getNodes().get(originID),
|
||||
graph.getNodes().get(destinationID)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates valid data sets
|
||||
*/
|
||||
private void initValidPathList() {
|
||||
validTestData = new ArrayList<>();
|
||||
|
||||
validTestData.add(new PathDataset(
|
||||
graphInsa,
|
||||
graphInsa.getNodes().get(512),
|
||||
graphInsa.getNodes().get(526)));
|
||||
validTestData.add(new PathDataset(
|
||||
graphSquare,
|
||||
graphSquare.getNodes().get(21),
|
||||
graphSquare.getNodes().get(17)));
|
||||
validTestData.add(getNewPathDataset(graphInsa, 512, 526));
|
||||
validTestData.add(getNewPathDataset(graphGuadeloupe, 12822, 13687));
|
||||
validTestData.add(getNewPathDataset(graphSquare, 21, 17));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -161,15 +165,10 @@ public abstract class AlgoTest {
|
|||
private void initInvalidPathList() {
|
||||
invalidTestData = new ArrayList<>();
|
||||
|
||||
invalidTestData.add(new PathDataset(
|
||||
graphBretagne,
|
||||
graphBretagne.getNodes().get(29270),
|
||||
graphBretagne.getNodes().get(545599)));
|
||||
|
||||
invalidTestData.add(new PathDataset(
|
||||
graphSquare,
|
||||
graphSquare.getNodes().get(10),
|
||||
graphSquare.getNodes().get(10)));
|
||||
invalidTestData.add(getNewPathDataset(graphBretagne, 29270, 545599));
|
||||
invalidTestData.add(getNewPathDataset(graphGuadeloupe, 26963, 4307));
|
||||
invalidTestData.add(getNewPathDataset(graphGuadeloupe, 8185, 8185));
|
||||
invalidTestData.add(getNewPathDataset(graphSquare, 10, 10));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue