/* * linmath_test.h * * Created on: Apr 9, 2017 * Author: Danylo Ulianych */ #ifndef LINMATH_TEST_H #define LINMATH_TEST_H #include #include "linmath.h" #define LINMATH_EPS (0.0001f) #define linmath_is_close(val1, val2) (fabsf(val1 - val2) < LINMATH_EPS) #ifndef linmath_assert #include #define linmath_assert assert #endif /* linmath_assert */ static float linmath_random_float() { return rand() / (float) RAND_MAX; } #define LINMATH_TEST_DEFINE_VEC(n) \ static void linmath_vec##n##_set(vec##n v, float value) { \ int i; \ for (i=0; i