public class ptLineDistSq
implements Testlet
{
public void test(TestHarness harness)
{
Line2D line1 = new Line2D.Double(0.0, 0.0, 1.0, 0.0);
harness.check(0.0, line1.ptLineDistSq(-50.0, 0.0));
harness.check(0.0, line1.ptLineDistSq(0.0, 0.0));
harness.check(0.0, line1.ptLineDistSq(1.0, 0.0));
harness.check(0.0, line1.ptLineDistSq(50.0, 0.0));
harness.check(1.0, line1.ptLineDistSq(-50.0, 1.0));
harness.check(1.0, line1.ptLineDistSq(0.0, 1.0));
harness.check(1.0, line1.ptLineDistSq(1.0, 1.0));
harness.check(1.0, line1.ptLineDistSq(50.0, 1.0));
harness.check(1.0, line1.ptLineDistSq(-50.0, -1.0));
harness.check(1.0, line1.ptLineDistSq(0.0, -1.0));
harness.check(1.0, line1.ptLineDistSq(1.0, -1.0));
harness.check(1.0, line1.ptLineDistSq(50.0, -1.0));
harness.check(0.0, line1.ptLineDistSq(new Point2D.Double(-50.0, 0.0)));
harness.check(0.0, line1.ptLineDistSq(new Point2D.Double(0.0, 0.0)));
harness.check(0.0, line1.ptLineDistSq(new Point2D.Double(1.0, 0.0)));
harness.check(0.0, line1.ptLineDistSq(new Point2D.Double(50.0, 0.0)));
harness.check(1.0, line1.ptLineDistSq(new Point2D.Double(-50.0, 1.0)));
harness.check(1.0, line1.ptLineDistSq(new Point2D.Double(0.0, 1.0)));
harness.check(1.0, line1.ptLineDistSq(new Point2D.Double(1.0, 1.0)));
harness.check(1.0, line1.ptLineDistSq(new Point2D.Double(50.0, 1.0)));
harness.check(1.0, line1.ptLineDistSq(new Point2D.Double(-50.0, -1.0)));
harness.check(1.0, line1.ptLineDistSq(new Point2D.Double(0.0, -1.0)));
harness.check(1.0, line1.ptLineDistSq(new Point2D.Double(1.0, -1.0)));
harness.check(1.0, line1.ptLineDistSq(new Point2D.Double(50.0, -1.0)));
boolean pass = false;
try {
line1.ptLineDistSq(null);
}
catch (NullPointerException e) {
pass = true;
}
harness.check(pass);