summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2022-10-24 17:17:50 -0400
committerDavid Thompson <dthompson2@worcester.edu>2022-10-24 17:18:29 -0400
commit4047c0d0a92eae8a7394b4caa479d0cb6dd9017c (patch)
tree2c7a4e6a6b22120dcd9d74a282bbc1c1d12de809 /tests
parente8674680c41ae856b5b83b3904caca9728b57fce (diff)
math: matrix: Add copy procedures.
Diffstat (limited to 'tests')
-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