main.c 740 B

123456789101112131415161718192021222324252627282930313233343536
  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 - Main */
  8. #include "tests.h"
  9. bool float_eq(float a, float b, float t)
  10. {
  11. return fabsf(a - b) < t;
  12. }
  13. #define Test(_t) printf(" "#_t); _t(); printf(" \tok\n");
  14. int main()
  15. {
  16. printf("vec3f tests\n");
  17. Test(test_ovec3f_normalize_me);
  18. Test(test_ovec3f_get_length);
  19. Test(test_ovec3f_get_angle);
  20. Test(test_ovec3f_get_dot);
  21. printf("\n");
  22. printf("quatf tests\n");
  23. Test(test_oquatf_init_axis);
  24. Test(test_oquatf_get_rotated);
  25. printf("\n");
  26. printf("all a-ok\n");
  27. return 0;
  28. }