diff options
author | Daniel Llorens <daniel.llorens@bluewin.ch> | 2013-04-03 22:40:40 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2013-04-05 22:54:14 +0200 |
commit | ab1ca17986ee758b7ec4088bf3f6a596872b1677 (patch) | |
tree | 464b09e7c11c36e36b5a1eeac53af83ba9164ea5 /test-suite/tests/arrays.test | |
parent | b5159a471a1acbe1ad08ee5365d123912fcc607d (diff) | |
download | guile-ab1ca17986ee758b7ec4088bf3f6a596872b1677.tar.gz |
Remove double indirection in array-fill!
* libguile/array-map.c: new function rafill, like scm_array_fill_int,
but factors GVSET out of the loop. Use it in scm_array_fill_x instead of
scm_array_fill_int.
* test-suite/tests/arrays.test: add test for array-fill! with stride != 1.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'test-suite/tests/arrays.test')
-rw-r--r-- | test-suite/tests/arrays.test | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test-suite/tests/arrays.test b/test-suite/tests/arrays.test index aa976311f..0b3d57ca2 100644 --- a/test-suite/tests/arrays.test +++ b/test-suite/tests/arrays.test @@ -291,7 +291,15 @@ (pass-if "0" (array-fill! a 0) #t) (pass-if "123" (array-fill! a 123) #t) (pass-if "-123" (array-fill! a -123) #t) - (pass-if "5/8" (array-fill! a 5/8) #t)))) + (pass-if "5/8" (array-fill! a 5/8) #t))) + + (with-test-prefix "noncompact" + (let* ((a (make-array 0 3 3)) + (b (make-shared-array a (lambda (i) (list i i)) 3))) + (array-fill! b 9) + (pass-if + (and (equal? b #(9 9 9)) + (equal? a #2((9 0 0) (0 9 0) (0 0 9)))))))) ;;; ;;; array-copy! |