Main.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #include <locale.h>
  2. #include <stdio.h>
  3. #include <string.h>
  4. #include "Test.h"
  5. #include "Tests.h"
  6. #include "core/Logger.h"
  7. #include "core/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. // coreTestArrayList(light);
  31. // coreTestArrayString();
  32. // coreTestBitArray();
  33. // coreTestBox();
  34. coreTestBuffer(light);
  35. // coreTestBufferedValue();
  36. // coreTestClock(light);
  37. // coreTestColor();
  38. // coreTestComponents();
  39. // coreTestFileReader();
  40. // coreTestFrustum();
  41. // coreTestHashedString();
  42. // coreTestHashMap(light);
  43. // coreTestLinkedList(light);
  44. // coreTestList(light);
  45. // coreTestMath();
  46. // coreTestMatrixStack(light);
  47. // coreTestMatrix();
  48. // coreTestPlane();
  49. // coreTestQuaternion();
  50. coreTestRandom(light);
  51. // coreTestRingBuffer();
  52. // coreTestStack(light);
  53. // coreTestThread();
  54. // coreTestUniquePointer();
  55. coreTestUtility();
  56. // coreTestVector();
  57. // coreTestView();
  58. coreLogLevel = CORE_LOG_WARNING;
  59. CORE_LOG_DEBUG("You won't see this!");
  60. coreLogLevel = CORE_LOG_DEBUG;
  61. unsigned int data = 123456789;
  62. coreSetExitHandler(onExit, &data);
  63. CORE_EXIT(1);
  64. return 0;
  65. }