tests.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * OpenHMD - Free and Open Source API and drivers for immersive technology.
  3. * Copyright (C) 2013 Fredrik Hultin.
  4. * Copyright (C) 2013 Jakob Bornecrantz.
  5. * Distributed under the Boost 1.0 licence, see LICENSE for full text.
  6. */
  7. /* Unit Tests - Internal Interface */
  8. #ifndef TESTS_H
  9. #define TESTS_H
  10. #include <stdio.h>
  11. #include <stdbool.h>
  12. #include <math.h>
  13. #include "openhmdi.h"
  14. #define TAssert(_v) if((!_v)){ printf("\ntest failed: %s @ %s:%d\n", __func__, __FILE__, __LINE__); exit(1); }
  15. bool float_eq(float a, float b, float t);
  16. bool vec3f_eq(vec3f v1, vec3f v2, float t);
  17. // vec3f tests
  18. void test_ovec3f_normalize_me();
  19. void test_ovec3f_get_length();
  20. void test_ovec3f_get_angle();
  21. void test_ovec3f_get_dot();
  22. // quatf tests
  23. void test_oquatf_init_axis();
  24. void test_oquatf_get_rotated();
  25. void test_oquatf_mult();
  26. void test_oquatf_mult_me();
  27. void test_oquatf_normalize();
  28. void test_oquatf_get_length();
  29. void test_oquatf_get_mat4x4();
  30. void test_oquatf_get_mat3x3();
  31. void test_omat3x3_get_scales();
  32. void test_omat3x3_get_euler_angles();
  33. #endif