mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
test: add missing mat2x3 tests
Signed-off-by: Vincent Davis Jr <vince@underview.tech>
This commit is contained in:
@@ -31,6 +31,16 @@ test_rand_mat3(mat3 dest) {
|
||||
glm_mat4_pick3(m4, dest);
|
||||
}
|
||||
|
||||
void
|
||||
test_rand_mat3x2(mat3x2 dest) {
|
||||
dest[0][0] = drand48();
|
||||
dest[0][1] = drand48();
|
||||
dest[1][0] = drand48();
|
||||
dest[1][1] = drand48();
|
||||
dest[2][0] = drand48();
|
||||
dest[2][1] = drand48();
|
||||
}
|
||||
|
||||
void
|
||||
test_rand_mat2(mat2 dest) {
|
||||
dest[0][0] = drand48();
|
||||
@@ -39,6 +49,16 @@ test_rand_mat2(mat2 dest) {
|
||||
dest[1][1] = drand48();
|
||||
}
|
||||
|
||||
void
|
||||
test_rand_mat2x3(mat2x3 dest) {
|
||||
dest[0][0] = drand48();
|
||||
dest[0][1] = drand48();
|
||||
dest[0][2] = drand48();
|
||||
dest[1][0] = drand48();
|
||||
dest[1][1] = drand48();
|
||||
dest[1][2] = drand48();
|
||||
}
|
||||
|
||||
void
|
||||
test_rand_vec3(vec3 dest) {
|
||||
dest[0] = drand48();
|
||||
@@ -187,6 +207,19 @@ test_assert_mat2x3_eq_zero(mat2x3 m2x3) {
|
||||
TEST_SUCCESS
|
||||
}
|
||||
|
||||
test_status_t
|
||||
test_assert_mat2x3_eq(mat2x3 m1, mat2x3 m2) {
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
for (j = 0; j < 3; j++) {
|
||||
ASSERT(fabsf(m1[i][j] - m2[i][j]) <= 0.0000009)
|
||||
}
|
||||
}
|
||||
|
||||
TEST_SUCCESS
|
||||
}
|
||||
|
||||
test_status_t
|
||||
test_assert_mat2x4_eq_zero(mat2x4 m2x4) {
|
||||
int i, j;
|
||||
@@ -269,6 +302,19 @@ test_assert_mat3x2_eq_zero(mat3x2 m3x2) {
|
||||
TEST_SUCCESS
|
||||
}
|
||||
|
||||
test_status_t
|
||||
test_assert_mat3x2_eq(mat3x2 m1, mat3x2 m2) {
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
for (j = 0; j < 2; j++) {
|
||||
ASSERT(fabsf(m1[i][j] - m2[i][j]) <= 0.0000009)
|
||||
}
|
||||
}
|
||||
|
||||
TEST_SUCCESS
|
||||
}
|
||||
|
||||
test_status_t
|
||||
test_assert_mat3x4_eq_zero(mat3x4 m3x4) {
|
||||
int i, j;
|
||||
|
||||
Reference in New Issue
Block a user