Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/test
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4136/src/net/sourceforge/bprocessor/model/test
Modified Files:
LineTest.java
Log Message:
added testcase
Index: LineTest.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/test/LineTest.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** LineTest.java 18 Sep 2006 14:36:50 -0000 1.5
--- LineTest.java 16 Feb 2007 09:50:38 -0000 1.6
***************
*** 88,91 ****
--- 88,92 ----
public void testIntersection() {
{
+ //simple test
Vertex o1 = new Vertex(0, 1, 0);
Vertex d1 = new Vertex(0, 0, 1);
***************
*** 100,103 ****
--- 101,105 ----
}
{
+ //simple test
Vertex o1 = new Vertex(0.5, 0.86734, 0);
Vertex d1 = new Vertex(0, 0, 1);
***************
*** 111,115 ****
Vertex iActual = l1.intersection(l2);
assertTrue(iTrue.equalEps(iActual));
! }
}
}
--- 113,157 ----
Vertex iActual = l1.intersection(l2);
assertTrue(iTrue.equalEps(iActual));
! }
! {
! //same origin
! Vertex o1 = new Vertex(0, 0, 0);
! Vertex d1 = new Vertex(0, 0, -1);
! Line l1 = new Line(o1, d1);
!
! Vertex o2 = new Vertex(0, 0, 0);
! Vertex d2 = new Vertex(0, 1, 0);
! Line l2 = new Line(o2, d2);
!
! Vertex i = new Vertex(0, 0, 0);
! assertTrue(l1.intersection(l2).equalEps(i));
! }
! {
! //same direction - coinciding
! Vertex o1 = new Vertex(0, 0, 0);
! Vertex d1 = new Vertex(0, 0, -1);
! Line l1 = new Line(o1, d1);
!
! Vertex o2 = new Vertex(0, 0, 0);
! Vertex d2 = new Vertex(0, 0, -1);
! Line l2 = new Line(o2, d2);
!
! assertTrue(l1.intersection(l2) == null);
! }
! {
! //same direction - parrallel
! Vertex o1 = new Vertex(0, 0, 0);
! Vertex d1 = new Vertex(0, 0, -1);
! Line l1 = new Line(o1, d1);
!
! Vertex o2 = new Vertex(0, 1, 2);
! Vertex d2 = new Vertex(0, 0, -1);
! Line l2 = new Line(o2, d2);
!
! assertTrue(l1.intersection(l2) == null);
! }
!
!
!
}
}
|