mirror of
https://github.com/recp/cglm.git
synced 2026-01-01 13:16:11 +00:00
Merge branch 'master' into vec2_mat2
This commit is contained in:
@@ -8,20 +8,7 @@
|
||||
#ifndef test_common_h
|
||||
#define test_common_h
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <setjmp.h>
|
||||
#include <cmocka.h>
|
||||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <cglm/cglm.h>
|
||||
#include <cglm/struct.h>
|
||||
#include <cglm/call.h>
|
||||
#include "../include/common.h"
|
||||
|
||||
void
|
||||
test_rand_mat4(mat4 dest);
|
||||
@@ -29,37 +16,58 @@ test_rand_mat4(mat4 dest);
|
||||
void
|
||||
test_rand_mat3(mat3 dest);
|
||||
|
||||
void
|
||||
test_status_t
|
||||
test_assert_eqf(float a, float b);
|
||||
|
||||
void
|
||||
test_status_t
|
||||
test_assert_mat4_eq(mat4 m1, mat4 m2);
|
||||
|
||||
void
|
||||
test_status_t
|
||||
test_assert_mat4_eqt(mat4 m1, mat4 m2);
|
||||
|
||||
test_status_t
|
||||
test_assert_mat4_eq2(mat4 m1, mat4 m2, float eps);
|
||||
|
||||
void
|
||||
test_status_t
|
||||
test_assert_mat4_eq_identity(mat4 m4);
|
||||
|
||||
test_status_t
|
||||
test_assert_mat4_eq_zero(mat4 m4);
|
||||
|
||||
test_status_t
|
||||
test_assert_mat3_eq(mat3 m1, mat3 m2);
|
||||
|
||||
void
|
||||
test_status_t
|
||||
test_assert_vec2_eq(vec2 v1, vec2 v2);
|
||||
|
||||
void
|
||||
test_status_t
|
||||
test_assert_mat3_eqt(mat3 m1, mat3 m2);
|
||||
|
||||
test_status_t
|
||||
test_assert_mat3_eq_identity(mat3 m3);
|
||||
|
||||
test_status_t
|
||||
test_assert_mat3_eq_zero(mat3 m3);
|
||||
|
||||
test_status_t
|
||||
test_assert_vec3_eq(vec3 v1, vec3 v2);
|
||||
|
||||
void
|
||||
test_status_t
|
||||
test_assert_vec3s_eq(vec3s v1, vec3s v2);
|
||||
|
||||
void
|
||||
test_status_t
|
||||
test_assert_vec4_eq(vec4 v1, vec4 v2);
|
||||
|
||||
void
|
||||
test_status_t
|
||||
test_assert_vec4s_eq(vec4s v1, vec4s v2);
|
||||
|
||||
void
|
||||
test_status_t
|
||||
test_assert_quat_eq(versor v1, versor v2);
|
||||
|
||||
void
|
||||
test_status_t
|
||||
test_assert_quat_eq_identity(versor q) ;
|
||||
|
||||
test_status_t
|
||||
test_assert_quat_eq_abs(versor v1, versor v2);
|
||||
|
||||
void
|
||||
@@ -80,4 +88,16 @@ test_rand(void);
|
||||
void
|
||||
test_rand_quat(versor q);
|
||||
|
||||
CGLM_INLINE
|
||||
bool
|
||||
test_eq(float a, float b) {
|
||||
return fabsf(a - b) <= 1e-6;
|
||||
}
|
||||
|
||||
CGLM_INLINE
|
||||
bool
|
||||
test_eq_th(float a, float b, float th) {
|
||||
return fabsf(a - b) <= th;
|
||||
}
|
||||
|
||||
#endif /* test_common_h */
|
||||
|
||||
Reference in New Issue
Block a user