[mcclim-cvs] CVS mcclim/Tests

crhodes crhodes at common-lisp.net
Mon Mar 6 16:09:12 UTC 2006


Update of /project/mcclim/cvsroot/mcclim/Tests
In directory clnet:/tmp/cvs-serv2997/Tests

Modified Files:
	regions.lisp 
Log Message:
Fix a couple of region bugs
* the infinite loop in point/point intersection noted in the tests
* isum-member was broken for more than one rectangle in the same 
  horizontal band.  Add test for this case.


--- /project/mcclim/cvsroot/mcclim/Tests/regions.lisp	2005/09/12 21:23:56	1.4
+++ /project/mcclim/cvsroot/mcclim/Tests/regions.lisp	2006/03/06 16:09:12	1.5
@@ -83,8 +83,6 @@
   (assert (member p2 regions :test #'region-equal)))
 
 ;;; intersection of two different points
-;;; this test fails.  It loops forever
-#+(or)
 (let* ((p1 (make-point 10 -10))
        (p2 (make-point -10 10))
        (i (region-intersection p1 p2)))
@@ -106,6 +104,18 @@
     (assert (null (set-difference regions regions2 :test #'region-equal)))
     (assert (null (set-difference regions2 regions :test #'region-equal)))))
 
+;;; standard-rectangle-set and containment calculation
+(let* ((r1 (make-rectangle* 0 0 1 1))
+       (r2 (make-rectangle* 2 0 3 1))
+       (ru (region-union r1 r2)))
+  (assert (not (region-contains-position-p ru -1/2 1/2)))
+  (assert (region-contains-position-p ru 1/2 1/2))
+  (assert (not (region-contains-position-p ru 3/2 1/2)))
+  (assert (region-contains-position-p ru 5/2 1/2))
+  (assert (not (region-contains-position-p ru 7/2 1/2)))
+  (assert (not (region-contains-position-p ru 1/2 3/2)))
+  (assert (not (region-contains-position-p ru 5/2 -1/2))))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;
 ;;; polyline




More information about the Mcclim-cvs mailing list