Main.cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #include <stdio.h>
  2. #include "test/Test.h"
  3. #include "tests/ArrayListTests.h"
  4. #include "tests/ArrayStringTests.h"
  5. #include "tests/ArrayTests.h"
  6. #include "tests/BitArrayTests.h"
  7. #include "tests/BoxTests.h"
  8. #include "tests/BufferedValueTests.h"
  9. #include "tests/ComponentsTests.h"
  10. #include "tests/FrustumTests.h"
  11. #include "tests/HashMapTests.h"
  12. #include "tests/LinkedListTests.h"
  13. #include "tests/ListTests.h"
  14. #include "tests/MathTests.h"
  15. #include "tests/MatrixStackTests.h"
  16. #include "tests/MatrixTests.h"
  17. #include "tests/PlaneTests.h"
  18. #include "tests/QuaternionTests.h"
  19. #include "tests/RingBufferTests.h"
  20. #include "tests/StackTests.h"
  21. #include "tests/UniquePointerTests.h"
  22. #include "tests/UtilityTests.h"
  23. #include "tests/VectorTests.h"
  24. #include "tests/ViewTests.h"
  25. #include "utils/Utility.h"
  26. static void onExit(int code, void* data) {
  27. unsigned int i = *static_cast<unsigned int*>(data);
  28. printf("Hello from exit %d: 0x%x\n", code, i);
  29. }
  30. static void onError(const char* file, int line, Core::Error e, void* data) {
  31. if(e == Core::Error::CAPACITY_REACHED ||
  32. e == Core::Error::INVALID_REMOVE_INDEX) {
  33. return;
  34. }
  35. (void)data;
  36. CORE_LOG_ERROR("Error in #:# - #", file, line, static_cast<int>(e));
  37. }
  38. int main() {
  39. Core::setErrorHandler(onError, nullptr);
  40. Core::ArrayListTests::test();
  41. Core::ArrayStringTests::test();
  42. Core::ArrayTests::test();
  43. Core::BitArrayTests::test();
  44. Core::BoxTests::test();
  45. Core::BufferedValueTests::test();
  46. Core::ComponentsTests::test();
  47. Core::FrustumTests::test();
  48. Core::HashMapTests::test();
  49. Core::LinkedListTests::test();
  50. Core::ListTests::test();
  51. Core::MathTests::test();
  52. Core::MatrixStackTests::test();
  53. Core::MatrixTests::test();
  54. Core::PlaneTests::test();
  55. Core::QuaternionTests::test();
  56. Core::RingBufferTests::test();
  57. Core::StackTests::test();
  58. Core::UniquePointerTests::test();
  59. Core::UtilityTests::test();
  60. Core::VectorTests::test();
  61. Core::ViewTests::test();
  62. Core::Test::finalize();
  63. unsigned int data = 0x1234;
  64. Core::setExitHandler(onExit, &data);
  65. CORE_EXIT(0);
  66. return 0;
  67. }