edu.umd.cfar.lamp.viper.geometry
Class GeometryTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byedu.umd.cfar.lamp.viper.geometry.GeometryTest
All Implemented Interfaces:
junit.framework.Test

public class GeometryTest
extends junit.framework.TestCase

Testsuite for the geometry package.


Constructor Summary
GeometryTest(java.lang.String name)
          Constructs a new test of the geometry package.
 
Method Summary
static boolean closeEnough(double alpha, double beta)
          Tests to see if two doubles are within some epsilon.
protected  void setUp()
           
static junit.framework.Test suite()
          Creates the test suite
 void testBBoxEquals()
          Tests the BoundingBox's equality methods.
 void testCircles()
          Exercises the Circle type.
 void testCPolyAdd()
          Tests the ConvexPolygon's add methods.
 void testCPolyArea()
          Tests the ConvexPolygon's area methods.
 void testCPolyChildren()
          Test intersection of bbox and obox
 void testCPolyClip()
          Tests the ConvexPolygon's clipping methods.
 void testCPolyEquals()
          Tests the ConvexPolygon's equality methods.
 void testCPolyIntersection()
          Tests the ConvexPolygon's intersection methods.
 void testCPolyIntersects()
          Tests the ConvexPolygon's intersection tests and computations.
 void testCPolySubtract()
          Tests the ConvexPolygon's subtraction methods.
 void testCPolyUnion()
          Tests the ConvexPolygon's union methods.
 void testGetNearIntersection()
          Tests the getNearIntersection methods.
 void testOBoxEquals()
          Tests the OrientedBox's equality methods.
 void testOBoxNegativeDistanceError()
          Tests the for a specific error that used to occur when computing the area shared by multiple boxes.
 void testPolyArea()
          Tests polygon area measurement.
 void testRationalEquals()
          Tests the Rational data type's equality methods.
 void testRationalInequality()
          Tests the Rational data type's inequality methods.
 void testRationalInfinity()
          Tests the Rational data type's ability to handle values outside the finite.
 void testRationalMath()
          Tests the Rational static math methods (plus, multiply, etc.).
 void testRationalOverflow()
          Tests the Rational data type's ability to handle numbers larger than 32 or 64 bits.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GeometryTest

public GeometryTest(java.lang.String name)
Constructs a new test of the geometry package.

Parameters:
name - the name of the test
Method Detail

setUp

protected void setUp()

suite

public static junit.framework.Test suite()
Creates the test suite

Returns:
the Test to run

testCircles

public void testCircles()
Exercises the Circle type.


testRationalEquals

public void testRationalEquals()
Tests the Rational data type's equality methods.


testRationalInequality

public void testRationalInequality()
Tests the Rational data type's inequality methods.


testRationalInfinity

public void testRationalInfinity()
Tests the Rational data type's ability to handle values outside the finite.


testRationalMath

public void testRationalMath()
Tests the Rational static math methods (plus, multiply, etc.).


testRationalOverflow

public void testRationalOverflow()
Tests the Rational data type's ability to handle numbers larger than 32 or 64 bits.


testCPolyEquals

public void testCPolyEquals()
Tests the ConvexPolygon's equality methods.


testPolyArea

public void testPolyArea()
Tests polygon area measurement. XXX: add self-intersecting polygons


closeEnough

public static boolean closeEnough(double alpha,
                                  double beta)
Tests to see if two doubles are within some epsilon.

Parameters:
alpha -
beta -
Returns:
if alpha is within an epsilon of beta

testCPolyArea

public void testCPolyArea()
Tests the ConvexPolygon's area methods.


testCPolyIntersects

public void testCPolyIntersects()
Tests the ConvexPolygon's intersection tests and computations.


testCPolySubtract

public void testCPolySubtract()
Tests the ConvexPolygon's subtraction methods.


testCPolyClip

public void testCPolyClip()
Tests the ConvexPolygon's clipping methods.


testCPolyIntersection

public void testCPolyIntersection()
Tests the ConvexPolygon's intersection methods.


testGetNearIntersection

public void testGetNearIntersection()
Tests the getNearIntersection methods.


testBBoxEquals

public void testBBoxEquals()
Tests the BoundingBox's equality methods.


testCPolyChildren

public void testCPolyChildren()
Test intersection of bbox and obox


testOBoxEquals

public void testOBoxEquals()
Tests the OrientedBox's equality methods.


testCPolyUnion

public void testCPolyUnion()
Tests the ConvexPolygon's union methods.


testCPolyAdd

public void testCPolyAdd()
Tests the ConvexPolygon's add methods.


testOBoxNegativeDistanceError

public void testOBoxNegativeDistanceError()
Tests the for a specific error that used to occur when computing the area shared by multiple boxes.