1 ;;; Dungeon Master --- Adventure generator for GNU Guile
2 ;;; Copyright © 2019 Javier Sancho <jsf@jsancho.org>
4 ;;; Dungeon Master is free software; you can redistribute it and/or modify it
5 ;;; under the terms of the GNU General Public License as published by
6 ;;; the Free Software Foundation; either version 3 of the License, or
7 ;;; (at your option) any later version.
9 ;;; Dungeon Master is distributed in the hope that it will be useful, but
10 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
11 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 ;;; General Public License for more details.
14 ;;; You should have received a copy of the GNU General Public License
15 ;;; along with Haunt. If not, see <http://www.gnu.org/licenses/>.
18 (define-module (test-bowyer-watson)
19 #:use-module (ice-9 receive)
20 #:use-module (srfi srfi-64)
21 #:use-module (dungeon-master geom bowyer-watson)
22 #:use-module (dungeon-master geom point))
24 (test-begin "bowyer-watson")
26 (receive (triangles points frame)
41 (define p1 (make-point 0 0))
42 (define p2 (make-point 0 10))
43 (define p3 (make-point 10 0))
44 (define p4 (make-point 10 10))
45 (define vertices (list p1 p2 p3 p4))
47 (receive (triangles points frame)
48 (bowyer-watson vertices)
60 (list (make-point -2.5 -2.5)
61 (make-point -2.5 12.5)
62 (make-point 12.5 -2.5)
63 (make-point 12.5 12.5))))
67 (exit (zero? (test-runner-fail-count (test-runner-current))))