1
0
mirror of synced 2026-02-03 07:30:58 +00:00
Files
Interlisp.medley/internal/test/Library/MATMULT/Auto/MAKE-HOMOGENEOUS-3-VECTOR.TEST
2020-12-28 10:33:23 -08:00

43 lines
1.3 KiB
Plaintext

;;MAKE-HOMOGENEOUS-3-VECTOR
;; By Peter Reidy
;; Filed as {ERIS}<LISPCORE>TEST>DISPLAY>MATMULT>MAKE-HOMOGENEOUS-3-VECTOR.TEST
;; Syntax: (MAKE-HOMOGENEOUS-3-VECTOR &optional X Y)
;; Function description: returns a 3-vector of element-type single-float; the elements are X and Y in the first 2 places, and 1.0 in the third.
;; Arguments: X, Y: optional values for the first and second elements of the vector.
;;
(do-test-group make-homogeneous-3-vector-tests
:before
(progn
(il:load? '{eris}<lispcore>test>display>matmult>matmult-test.source)
(test-setq random (- most-positive-single-float (random most-positive-single-float)))
)
;;
(do-test simple-3-vector-test
(let ((simple.vector (il:make-homogeneous-3-vector)))
(and
(vectest simple.vector 3)
(= 0.0 (aref simple.vector 0))
(= 0.0 (aref simple.vector 1))
)
)
)
;;
(do-test 3-vector-with-args-test
(let ((3x (il:make-homogeneous-3-vector random))
(3y (il:make-homogeneous-3-vector nil most-negative-single-float))
(3xy (il:make-homogeneous-3-vector random most-positive-single-float))
)
(every 'vectest (list 3x 3y 3xy) '(3))
)
)
;;
(do-test 3-vector-complex-test
(expect-errors (error)
(il:make-homogeneous-3-vector #c(3 5))
)
)
) ; do-test-group make-homogeneous-3-vector-tests
END