Improve tests.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1563285 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart 2014-01-31 22:06:49 +00:00
parent 8f7c59ce88
commit bcba29320f
2 changed files with 13 additions and 14 deletions

View File

@ -99,6 +99,19 @@ public abstract class ConvexHullGenerator2DAbstractTest {
}
}
@Test
public void testColinearPoints() {
final Collection<Vector2D> points = new ArrayList<Vector2D>();
points.add(new Vector2D(1, 1));
points.add(new Vector2D(2, 2));
points.add(new Vector2D(2, 4));
points.add(new Vector2D(4, 1));
points.add(new Vector2D(10, 1));
final ConvexHull2D hull = generator.generate(points);
checkConvexHull(points, hull);
}
// ------------------------------------------------------------------------------
protected final List<Vector2D> createRandomPoints(int size) {

View File

@ -17,7 +17,6 @@
package org.apache.commons.math3.geometry.euclidean.twod.hull;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.apache.commons.math3.geometry.euclidean.twod.Vector2D;
@ -36,19 +35,6 @@ public class GrahamScanTest extends ConvexHullGenerator2DAbstractTest {
// ------------------------------------------------------------------------------
@Test
public void testColinearPoints() {
final Collection<Vector2D> points = new ArrayList<Vector2D>();
points.add(new Vector2D(1, 1));
points.add(new Vector2D(2, 2));
points.add(new Vector2D(2, 4));
points.add(new Vector2D(4, 1));
points.add(new Vector2D(10, 1));
final ConvexHull2D hull = generator.generate(points);
checkConvexHull(points, hull);
}
@Test
public void testIdenticalPoints() {
final List<Vector2D> points = new ArrayList<Vector2D>();