[cl-gsl-cvs] CVS update: cl-gsl/test/test-vector.lisp

cl-gsl-cvs at common-lisp.net cl-gsl-cvs at common-lisp.net
Sat Apr 30 22:39:47 UTC 2005


Update of /project/cl-gsl/cvsroot/cl-gsl/test
In directory common-lisp.net:/tmp/cvs-serv4422

Modified Files:
	test-vector.lisp 
Log Message:
Slight sylistic changes to a few unit tests.

Date: Sun May  1 00:39:46 2005
Author: edenny

Index: cl-gsl/test/test-vector.lisp
diff -u cl-gsl/test/test-vector.lisp:1.6 cl-gsl/test/test-vector.lisp:1.7
--- cl-gsl/test/test-vector.lisp:1.6	Mon Apr 25 04:16:18 2005
+++ cl-gsl/test/test-vector.lisp	Sun May  1 00:39:46 2005
@@ -76,72 +76,65 @@
 (deftest "make-vector-double-float-initial-element" :category +vector+
          :test-fn
          #'(lambda ()
-             (let ((v (gsl-array:make-vector 5
-                                              :element-type 'double-float
-                                              :initial-element 1.0d0))
-                   (ret t))
-               (dotimes (i 5 ret)
-                 (unless (= (gsl-array:get-element v i) 1.0d0)
-                   (setq ret nil)))
-               (gsl-array:free v)
-               ret)))
+             (let ((v (gsl-array:make-vector 5 :element-type 'double-float
+                                             :initial-element 1.0d0)))
+               (prog1
+                   (dotimes (i 5 t)
+                     (unless (= (gsl-array:get-element v i) 1.0d0)
+                       (return nil)))
+                 (gsl-array:free v)))))
 
 
 (deftest "make-vector-single-float-initial-element" :category +vector+
          :test-fn
          #'(lambda ()
-             (let ((v (gsl-array:make-vector 5
-                                              :element-type 'single-float
-                                              :initial-element 1.0))
-                   (ret t))
-               (dotimes (i 5 ret)
-                 (unless (= (gsl-array:get-element v i) 1.0)
-                   (setq ret nil)))
-               (gsl-array:free v)
-               ret)))
+             (let ((v (gsl-array:make-vector 5 :element-type 'single-float
+                                             :initial-element 1.0)))
+               (prog1
+                   (dotimes (i 5 t)
+                     (unless (= (gsl-array:get-element v i) 1.0)
+                       (return nil)))
+                 (gsl-array:free v)))))
 
 
 (deftest "make-vector-integer-initial-element" :category +vector+
          :test-fn
          #'(lambda ()
-             (let ((v (gsl-array:make-vector 5
-                                              :element-type 'integer
-                                              :initial-element 1))
-                   (ret t))
-               (dotimes (i 5 ret)
-                 (unless (= (gsl-array:get-element v i) 1)
-                   (setq ret nil)))
-               (gsl-array:free v)
-               ret)))
+             (let ((v (gsl-array:make-vector 5 :element-type 'integer
+                                             :initial-element 1)))
+               (prog1
+                   (dotimes (i 5 t)
+                     (unless (= (gsl-array:get-element v i) 1)
+                       (return nil)))
+                 (gsl-array:free v)))))
 
 (deftest "make-vector-complex-double-float-initial-element" :category +vector+
          :test-fn
          #'(lambda ()
-             (let ((v (gsl-array:make-vector 5
-                                              :element-type
-                                              '(complex (double-float))
-                                              :initial-element
-                                              (complex 1.0d0 1.0d0)))
-                   (ret t))
-               (dotimes (i 5 ret)
-                 (unless (= (gsl-array:get-element v i) (complex 1.0d0 1.0d0))
-                   (setq ret nil)))
-               (gsl-array:free v)
-               ret)))
+             (let ((v (gsl-array:make-vector 5 :element-type
+                                             '(complex (double-float))
+                                             :initial-element
+                                             (complex 1.0d0 1.0d0))))
+               (prog1
+                   (dotimes (i 5 t)
+                     (unless (= (gsl-array:get-element v i)
+                                (complex 1.0d0 1.0d0))
+                       (return nil)))
+                 (gsl-array:free v)))))
+
 
 (deftest "make-vector-complex-single-float-initial-element" :category +vector+
          :test-fn
          #'(lambda ()
              (let ((v (gsl-array:make-vector 5 :element-type
-                                              '(complex (single-float))
-                                              :initial-element
-                                              (complex 1.0 1.0)))
-                   (ret t))
-               (dotimes (i 5 ret)
-                 (unless (= (gsl-array:get-element v i) (complex 1.0 1.0))
-                   (setq ret nil)))
-               (gsl-array:free v)
-               ret)))
+                                             '(complex (single-float))
+                                             :initial-element
+                                             (complex 1.0 1.0))))
+               (prog1
+                   (dotimes (i 5 t)
+                     (unless (= (gsl-array:get-element v i) (complex 1.0 1.0))
+                       (return nil)))
+                 (gsl-array:free v)))))
 
 ;; ----------------------------------------------------------------------
 
@@ -248,20 +241,18 @@
          #'(lambda ()
              (gsl-array:with-vector (v 5 :element-type 'single-float)
                (gsl-array:set-all v 5.0)
-               (let ((ret t))
-                 (dotimes (i 5 ret)
-                   (unless (= (gsl-array:get-element v i) 5.0)
-                     (setq ret nil)))))))
+               (dotimes (i 5 t)
+                 (unless (= (gsl-array:get-element v i) 5.0)
+                   (return nil))))))
 
 (deftest "set-all-integer" :category +vector+
          :test-fn
          #'(lambda ()
              (gsl-array:with-vector (v 5 :element-type 'integer)
                (gsl-array:set-all v 5)
-               (let ((ret t))
-                 (dotimes (i 5 ret)
-                   (unless (= (gsl-array:get-element v i) 5)
-                     (setq ret nil)))))))
+               (dotimes (i 5 t)
+                 (unless (= (gsl-array:get-element v i) 5)
+                   (return nil))))))
 
 (deftest "set-all-complex-double-float" :category +vector+
          :test-fn




More information about the Cl-gsl-cvs mailing list