[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: gaf.git: branch: master updated (1.7.2-20111231-10-g501d784)
The branch, master has been updated
via 501d784118e135be1ead32b1233e64bc62e8d41e (commit)
via ded664073d4e32b087a55359e15a43c65a26a653 (commit)
from 86f652cdad7f0635b431dc462918a04ed9b257bf (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
libgeda/scheme/geda/object.scm | 2 +-
.../scheme/unit-tests/t0107-object-stroke-fill.scm | 42 ++++++++++++++++++++
libgeda/scheme/unit-tests/t0111-object-path.scm | 14 +++++++
libgeda/scheme/unit-tests/t0112-object-picture.scm | 11 +++++-
libgeda/scheme/unit-tests/t0200-page.scm | 2 +
libgeda/scheme/unit-tests/t0300-attribute.scm | 3 +
libgeda/src/scheme_object.c | 15 +++++--
7 files changed, 82 insertions(+), 7 deletions(-)
=================
Commit Messages
=================
commit 501d784118e135be1ead32b1233e64bc62e8d41e
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
scheme-api: Fix path operations involving curves.
Curve control points were not being processed correctly, meaning that
it was not possible to insert a curve into a path.
:100644 100644 bb00e04... aa9561b... M libgeda/scheme/geda/object.scm
:100644 100644 901c2be... 47eb5b7... M libgeda/src/scheme_object.c
commit ded664073d4e32b087a55359e15a43c65a26a653
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
scheme-api: Improve testsuite coverage.
:100644 100644 2b8de27... dfc7b80... M libgeda/scheme/unit-tests/t0107-object-stroke-fill.scm
:100644 100644 363b693... 67f46f6... M libgeda/scheme/unit-tests/t0111-object-path.scm
:100644 100644 2abb78e... 4f333a5... M libgeda/scheme/unit-tests/t0112-object-picture.scm
:100644 100644 0837c92... 2f8a7c9... M libgeda/scheme/unit-tests/t0200-page.scm
:100644 100644 d63cc07... 8d4707e... M libgeda/scheme/unit-tests/t0300-attribute.scm
=========
Changes
=========
commit 501d784118e135be1ead32b1233e64bc62e8d41e
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
scheme-api: Fix path operations involving curves.
Curve control points were not being processed correctly, meaning that
it was not possible to insert a curve into a path.
diff --git a/libgeda/scheme/geda/object.scm b/libgeda/scheme/geda/object.scm
index bb00e04..aa9561b 100644
--- a/libgeda/scheme/geda/object.scm
+++ b/libgeda/scheme/geda/object.scm
@@ -254,7 +254,7 @@
acc
(transform-points
(cdr lst)
- (list (caar lst) (cdar lst)))))
+ (append acc (list (caar lst) (cdar lst))))))
(apply %path-insert p idx type (transform-points points '())))
diff --git a/libgeda/src/scheme_object.c b/libgeda/src/scheme_object.c
index 901c2be..47eb5b7 100644
--- a/libgeda/src/scheme_object.c
+++ b/libgeda/src/scheme_object.c
@@ -1786,15 +1786,19 @@ SCM_DEFINE (path_insert_x, "%path-insert", 3, 6, 0,
/* Check the right number of coordinates have been provided. */
switch (section.code) {
case PATH_CURVETO:
+ SCM_ASSERT (scm_is_integer (x1_s), x1_s, SCM_ARG4, s_path_insert_x);
+ section.x1 = scm_to_int (x1_s);
+ SCM_ASSERT (scm_is_integer (y1_s), y1_s, SCM_ARG5, s_path_insert_x);
+ section.y1 = scm_to_int (y1_s);
SCM_ASSERT (scm_is_integer (x2_s), x2_s, SCM_ARG6, s_path_insert_x);
- section.x1 = scm_to_int (x2_s);
+ section.x2 = scm_to_int (x2_s);
SCM_ASSERT (scm_is_integer (y2_s), y2_s, SCM_ARG7, s_path_insert_x);
- section.y1 = scm_to_int (y2_s);
+ section.y2 = scm_to_int (y2_s);
SCM_ASSERT (scm_is_integer (x3_s), x3_s, 8, s_path_insert_x);
- section.x2 = scm_to_int (x3_s);
+ section.x3 = scm_to_int (x3_s);
SCM_ASSERT (scm_is_integer (y3_s), y3_s, 9, s_path_insert_x);
- section.y2 = scm_to_int (y3_s);
- /* Intentionally falls through */
+ section.y3 = scm_to_int (y3_s);
+ break;
case PATH_MOVETO:
case PATH_MOVETO_OPEN:
case PATH_LINETO:
@@ -1802,6 +1806,7 @@ SCM_DEFINE (path_insert_x, "%path-insert", 3, 6, 0,
section.x3 = scm_to_int (x1_s);
SCM_ASSERT (scm_is_integer (y1_s), y1_s, SCM_ARG5, s_path_insert_x);
section.y3 = scm_to_int (y1_s);
+ break;
case PATH_END:
break;
}
commit ded664073d4e32b087a55359e15a43c65a26a653
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
scheme-api: Improve testsuite coverage.
diff --git a/libgeda/scheme/unit-tests/t0107-object-stroke-fill.scm b/libgeda/scheme/unit-tests/t0107-object-stroke-fill.scm
index 2b8de27..dfc7b80 100644
--- a/libgeda/scheme/unit-tests/t0107-object-stroke-fill.scm
+++ b/libgeda/scheme/unit-tests/t0107-object-stroke-fill.scm
@@ -29,6 +29,27 @@
(set-object-stroke! a 1 'round 'phantom 7 8)
(assert-equal '(phantom 7 8) (object-stroke-dash a))
(assert-equal a (apply set-object-stroke! a (object-stroke a)))
+
+ ;; Invalid symbol arguments
+ (assert-thrown 'misc-error
+ (set-object-stroke! a 1 'BAD-VALUE 'solid))
+ (assert-thrown 'misc-error
+ (set-object-stroke! a 1 'none 'BAD-VALUE))
+ ;; Missing dash length/space arguments
+ (assert-thrown 'misc-error
+ (set-object-stroke! a 1 'none 'dashed 5))
+ (assert-thrown 'misc-error
+ (set-object-stroke! a 1 'none 'dashed))
+ (assert-thrown 'misc-error
+ (set-object-stroke! a 1 'none 'center 5))
+ (assert-thrown 'misc-error
+ (set-object-stroke! a 1 'none 'center))
+ (assert-thrown 'misc-error
+ (set-object-stroke! a 1 'none 'phantom 5))
+ (assert-thrown 'misc-error
+ (set-object-stroke! a 1 'none 'phantom))
+ (assert-thrown 'misc-error
+ (set-object-stroke! a 1 'none 'dotted))
))
(begin-test 'fill
@@ -49,4 +70,25 @@
(assert-equal a (set-object-fill! a 'mesh 4 5 6 7 8))
(assert-equal '(mesh 4 5 6 7 8) (object-fill a))
(assert-equal a (apply set-object-fill! a (object-fill a)))
+
+ ;; Invalid symbol arguments
+ (assert-thrown 'misc-error
+ (set-object-fill! a 'BAD-VALUE))
+ ;; Missing fill width/angle/space arguments
+ (assert-thrown 'misc-error
+ (set-object-fill! a 'hatch))
+ (assert-thrown 'misc-error
+ (set-object-fill! a 'hatch 1))
+ (assert-thrown 'misc-error
+ (set-object-fill! a 'hatch 1 2))
+ (assert-thrown 'misc-error
+ (set-object-fill! a 'mesh))
+ (assert-thrown 'misc-error
+ (set-object-fill! a 'mesh 1))
+ (assert-thrown 'misc-error
+ (set-object-fill! a 'mesh 1 2))
+ (assert-thrown 'misc-error
+ (set-object-fill! a 'mesh 1 2 3))
+ (assert-thrown 'misc-error
+ (set-object-fill! a 'mesh 1 2 3 4))
))
diff --git a/libgeda/scheme/unit-tests/t0111-object-path.scm b/libgeda/scheme/unit-tests/t0111-object-path.scm
index 363b693..67f46f6 100644
--- a/libgeda/scheme/unit-tests/t0111-object-path.scm
+++ b/libgeda/scheme/unit-tests/t0111-object-path.scm
@@ -34,6 +34,20 @@
(assert-thrown 'out-of-range (path-remove! a 1))
(assert-equal '((1 . 0) . (1 . 0)) (object-bounds a))
+ ; Add a line, a curve and a closepath.
+ (assert-equal a (path-insert! a -1 'lineto '(1 . 2)))
+ (assert-equal '(lineto (1 . 2)) (path-ref a 1))
+ (assert-equal a (path-insert! a -1 'curveto
+ '(3 . 4) '(5 . 6) '(7 . 8)))
+ (assert-equal '(curveto (3 . 4) (5 . 6) (7 . 8)) (path-ref a 2))
+ (assert-equal a (path-insert! a -1 'closepath))
+ (assert-equal '(closepath) (path-ref a 3))
+
+ (assert-equal a (path-remove! a 1))
+
+ ; Bad path element type
+ (assert-thrown 'misc-error (path-insert! a -1 'BAD-VALUE))
+
; Color
(assert-equal 21 (object-color b))
))
diff --git a/libgeda/scheme/unit-tests/t0112-object-picture.scm b/libgeda/scheme/unit-tests/t0112-object-picture.scm
index 2abb78e..4f333a5 100644
--- a/libgeda/scheme/unit-tests/t0112-object-picture.scm
+++ b/libgeda/scheme/unit-tests/t0112-object-picture.scm
@@ -55,4 +55,13 @@ static char * test_image_xpm[] = {
(assert-equal '(3 . 3) (picture-top-left a))
(assert-equal '(7 . 1) (picture-bottom-right a))
(assert-equal 0 (picture-angle a))
- (assert-equal #f (picture-mirror? a))))
+ (assert-equal #f (picture-mirror? a))
+
+ ;; Bad angle
+ (assert-thrown 'misc-error (set-picture! a '(1 . 2) '(5 . 4) 45 #f))
+ ;; Bad data
+ (assert-thrown 'misc-error
+ (make-picture/vector
+ (map char->integer (string->list "THIS IS NOT AN IMAGE"))
+ "not_an_image" '(1 . 2) '(5 . 4) 0 #f))
+))
diff --git a/libgeda/scheme/unit-tests/t0200-page.scm b/libgeda/scheme/unit-tests/t0200-page.scm
index 0837c92..2f8a7c9 100644
--- a/libgeda/scheme/unit-tests/t0200-page.scm
+++ b/libgeda/scheme/unit-tests/t0200-page.scm
@@ -8,6 +8,8 @@
(begin-test 'page
(let ((page-a (make-page "/test/page/A"))
(page-b (make-page "/test/page/B")))
+ (assert-true (page? page-a))
+
(assert-equal "/test/page/A" (page-filename page-a))
(assert-equal (list page-a page-b) (active-pages))
diff --git a/libgeda/scheme/unit-tests/t0300-attribute.scm b/libgeda/scheme/unit-tests/t0300-attribute.scm
index d63cc07..8d4707e 100644
--- a/libgeda/scheme/unit-tests/t0300-attribute.scm
+++ b/libgeda/scheme/unit-tests/t0300-attribute.scm
@@ -53,6 +53,9 @@
;; component
(assert-thrown 'object-state (attach-attribs! q x))
+ ;; Attach attribute to attached attribute, within same component
+ (assert-thrown 'object-state (attach-attribs! x y))
+
;; Attach attribute to object in different component
(assert-thrown 'object-state (attach-attribs! p z))
(assert-equal (list x) (object-attribs p))
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs