From bcba29320f5f6f860335266d6be8249418ceaedb Mon Sep 17 00:00:00 2001 From: Thomas Neidhart Date: Fri, 31 Jan 2014 22:06:49 +0000 Subject: [PATCH] Improve tests. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1563285 13f79535-47bb-0310-9956-ffa450edef68 --- .../hull/ConvexHullGenerator2DAbstractTest.java | 13 +++++++++++++ .../euclidean/twod/hull/GrahamScanTest.java | 14 -------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/test/java/org/apache/commons/math3/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java b/src/test/java/org/apache/commons/math3/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java index 136cd4faf..8c9d7a2a3 100644 --- a/src/test/java/org/apache/commons/math3/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java +++ b/src/test/java/org/apache/commons/math3/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java @@ -99,6 +99,19 @@ public abstract class ConvexHullGenerator2DAbstractTest { } } + @Test + public void testColinearPoints() { + final Collection points = new ArrayList(); + 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 createRandomPoints(int size) { diff --git a/src/test/java/org/apache/commons/math3/geometry/euclidean/twod/hull/GrahamScanTest.java b/src/test/java/org/apache/commons/math3/geometry/euclidean/twod/hull/GrahamScanTest.java index a2bb6a486..8ee32a112 100644 --- a/src/test/java/org/apache/commons/math3/geometry/euclidean/twod/hull/GrahamScanTest.java +++ b/src/test/java/org/apache/commons/math3/geometry/euclidean/twod/hull/GrahamScanTest.java @@ -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 points = new ArrayList(); - 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 points = new ArrayList();