Main.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #include <locale.h>
  2. #include <stdio.h>
  3. #include <string.h>
  4. #include "Test.h"
  5. #include "Tests.h"
  6. #include "core/utils/Logger.h"
  7. #include "core/utils/Utility.h"
  8. static void onExit(int code, void* data) {
  9. unsigned int i = *(unsigned int*)(data);
  10. CORE_LOG_WARNING("Hello from exit %d: %u", code, i);
  11. coreFinalizeTests();
  12. corePrintMemoryReport();
  13. }
  14. int main(int argAmount, const char** args) {
  15. setlocale(LC_ALL, "en_US.utf8");
  16. bool light = false;
  17. for(int i = 0; i < argAmount; i++) {
  18. if(strcmp(args[i], "light") == 0) {
  19. light = true;
  20. } else if(strcmp(args[i], "alloc") == 0) {
  21. coreTestInvalidAllocate();
  22. } else if(strcmp(args[i], "realloc") == 0) {
  23. coreTestInvalidReallocate();
  24. } else if(strcmp(args[i], "pre_canary") == 0) {
  25. coreTestPreCanary();
  26. } else if(strcmp(args[i], "post_canary") == 0) {
  27. coreTestPostCanary();
  28. }
  29. }
  30. (void)light;
  31. /*
  32. Core::testArrayList(light);
  33. Core::testArrayString();
  34. Core::testArray();
  35. Core::testBitArray();
  36. Core::testBox();
  37. Core::testBuffer(light);
  38. Core::testBufferedValue();
  39. Core::testClock(light);
  40. Core::testColor();
  41. Core::testComponents();
  42. Core::testError();
  43. Core::testFileReader();
  44. Core::testFrustum();
  45. Core::testHashedString();
  46. Core::testHashMap(light);
  47. Core::testLinkedList(light);
  48. Core::testList(light);
  49. Core::testMath();
  50. Core::testMatrixStack(light);
  51. Core::testMatrix();
  52. Core::testNew();
  53. Core::testPlane();
  54. Core::testQuaternion();
  55. Core::testRandom(light);
  56. Core::testRingBuffer();
  57. Core::testStack(light);
  58. Core::testThread();
  59. Core::testUniquePointer();*/
  60. coreTestUtility();
  61. /*Core::testVector();
  62. Core::testView();*/
  63. coreLogLevel = CORE_LOG_WARNING;
  64. CORE_LOG_DEBUG("You won't see this!");
  65. coreLogLevel = CORE_LOG_DEBUG;
  66. unsigned int data = 123456789;
  67. coreSetExitHandler(onExit, &data);
  68. CORE_EXIT(1);
  69. return 0;
  70. }