aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSebastian Pahnke <pahnke.sebastian@gmail.com>2024-12-28 09:05:26 +0100
committerSebastian Pahnke <pahnke.sebastian@gmail.com>2024-12-28 10:29:43 +0100
commit0d955e55dbe9aaefebddde222d8bd62c59236eae (patch)
tree5c5fcdec1c97627555f5d3d23e6d52396dead4de /tests
parente8a202f0a27256162f8fe20f4d92cdb63ec1e967 (diff)
Add tests for determinants because their calculation depends on the adjugate
Diffstat (limited to 'tests')
-rw-r--r--tests/issues/test_issue_4584.odin8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/issues/test_issue_4584.odin b/tests/issues/test_issue_4584.odin
index 176daf6af..f14f1f1d3 100644
--- a/tests/issues/test_issue_4584.odin
+++ b/tests/issues/test_issue_4584.odin
@@ -21,9 +21,11 @@ test_adjugate_2x2 :: proc(t: ^testing.T) {
testing.expect_value(t, linalg.adjugate(m) * m, 2 * linalg.identity(matrix[2,2]int))
testing.expect_value(t, glm.adjugate(m), expected)
+ testing.expect_value(t, glm.determinant(m), 2)
testing.expect_value(t, glm.adjugate(m) * m, 2 * linalg.identity(matrix[2,2]int))
testing.expect_value(t, hlm.adjugate(m), expected)
+ testing.expect_value(t, hlm.determinant(m), 2)
testing.expect_value(t, hlm.adjugate(m) * m, 2 * linalg.identity(matrix[2,2]int))
}
@@ -44,9 +46,11 @@ test_adjugate_3x3 :: proc(t: ^testing.T) {
testing.expect_value(t, linalg.adjugate(m) * m, -6 * linalg.identity(matrix[3,3]int))
testing.expect_value(t, glm.adjugate(m), expected)
+ testing.expect_value(t, glm.determinant(m), -6)
testing.expect_value(t, glm.adjugate(m) * m, -6 * linalg.identity(matrix[3,3]int))
testing.expect_value(t, hlm.adjugate(m), expected)
+ testing.expect_value(t, hlm.determinant(m), -6)
testing.expect_value(t, hlm.adjugate(m) * m, -6 * linalg.identity(matrix[3,3]int))
}
@@ -60,7 +64,7 @@ test_adjugate_4x4 :: proc(t: ^testing.T) {
}
expected := matrix[4,4]int {
-144, 266, -92, -16,
- 57, 92, -5, -16,
+ -57, 92, -5, -16,
105, -142, 55, 2,
33, -96, 9, -6,
}
@@ -69,8 +73,10 @@ test_adjugate_4x4 :: proc(t: ^testing.T) {
testing.expect_value(t, linalg.adjugate(m) * m, -174 * linalg.identity(matrix[4,4]int))
testing.expect_value(t, glm.adjugate(m), expected)
+ testing.expect_value(t, glm.determinant(m), -174)
testing.expect_value(t, glm.adjugate(m) * m, -174 * linalg.identity(matrix[4,4]int))
testing.expect_value(t, hlm.adjugate(m), expected)
+ testing.expect_value(t, hlm.determinant(m), -174)
testing.expect_value(t, hlm.adjugate(m) * m, -174 * linalg.identity(matrix[4,4]int))
} \ No newline at end of file