summaryrefslogtreecommitdiff
path: root/tests/matrix.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tests/matrix.scm')
-rw-r--r--tests/matrix.scm27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/matrix.scm b/tests/matrix.scm
index 7f36280..0cd24a9 100644
--- a/tests/matrix.scm
+++ b/tests/matrix.scm
@@ -24,7 +24,34 @@
#:use-module (chickadee math vector))
(with-tests "matrix"
+ (test-group "3x3 matrices"
+ (test-assert "matrix3-copy"
+ (let ((m (make-matrix3 0 1 2
+ 3 4 5
+ 6 7 8)))
+ (matrix3= m (matrix3-copy m))))
+ (test-assert "matrix3-copy!"
+ (let ((src (make-matrix3 0 1 2
+ 3 4 5
+ 6 7 8))
+ (dest (make-null-matrix3)))
+ (matrix3-copy! src dest)
+ (matrix3= src dest))))
(test-group "4x4 matrices"
+ (test-assert "matrix4-copy"
+ (let ((m (make-matrix4 0 1 2 3
+ 4 5 6 7
+ 8 9 0 1
+ 2 3 4 5)))
+ (matrix4= m (matrix4-copy m))))
+ (test-assert "matrix4-copy!"
+ (let ((src (make-matrix4 0 1 2 3
+ 4 5 6 7
+ 8 9 0 1
+ 2 3 4 5))
+ (dest (make-null-matrix4)))
+ (matrix4-copy! src dest)
+ (matrix4= src dest)))
(test-group "multiplication"
(test-assert "identity"
(let ((m (make-matrix4 0 1 2 3