aboutsummaryrefslogtreecommitdiff
path: root/tests/issues
diff options
context:
space:
mode:
authorSebastian Pahnke <pahnke.sebastian@gmail.com>2024-12-28 08:56:09 +0100
committerSebastian Pahnke <pahnke.sebastian@gmail.com>2024-12-28 10:29:43 +0100
commite8a202f0a27256162f8fe20f4d92cdb63ec1e967 (patch)
tree69e385a81b5be423741fa65b6fbe19435bf9ff4b /tests/issues
parent8a91e0bb19c013d0b088c90f3d1a09560dffac5c (diff)
Add tests for glsl and hlsl variants
Diffstat (limited to 'tests/issues')
-rw-r--r--tests/issues/test_issue_4584.odin20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/issues/test_issue_4584.odin b/tests/issues/test_issue_4584.odin
index b80ecb3d9..176daf6af 100644
--- a/tests/issues/test_issue_4584.odin
+++ b/tests/issues/test_issue_4584.odin
@@ -3,6 +3,8 @@ package test_issues
import "core:testing"
import "core:math/linalg"
+import glm "core:math/linalg/glsl"
+import hlm "core:math/linalg/hlsl"
@test
test_adjugate_2x2 :: proc(t: ^testing.T) {
@@ -17,6 +19,12 @@ test_adjugate_2x2 :: proc(t: ^testing.T) {
testing.expect_value(t, linalg.adjugate(m), expected)
testing.expect_value(t, linalg.determinant(m), 2)
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.adjugate(m) * m, 2 * linalg.identity(matrix[2,2]int))
+
+ testing.expect_value(t, hlm.adjugate(m), expected)
+ testing.expect_value(t, hlm.adjugate(m) * m, 2 * linalg.identity(matrix[2,2]int))
}
@test
@@ -34,6 +42,12 @@ test_adjugate_3x3 :: proc(t: ^testing.T) {
testing.expect_value(t, linalg.adjugate(m), expected)
testing.expect_value(t, linalg.determinant(m), -6)
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.adjugate(m) * m, -6 * linalg.identity(matrix[3,3]int))
+
+ testing.expect_value(t, hlm.adjugate(m), expected)
+ testing.expect_value(t, hlm.adjugate(m) * m, -6 * linalg.identity(matrix[3,3]int))
}
@test
@@ -53,4 +67,10 @@ test_adjugate_4x4 :: proc(t: ^testing.T) {
testing.expect_value(t, linalg.adjugate(m), expected)
testing.expect_value(t, linalg.determinant(m), -174)
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.adjugate(m) * m, -174 * linalg.identity(matrix[4,4]int))
+
+ testing.expect_value(t, hlm.adjugate(m), expected)
+ testing.expect_value(t, hlm.adjugate(m) * m, -174 * linalg.identity(matrix[4,4]int))
} \ No newline at end of file