Main.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. // coreTestComponents();
  31. coreTestBitArray();
  32. coreTestBox();
  33. coreTestBuffer(light);
  34. coreTestFrustum();
  35. coreTestHashMap(light);
  36. coreTestLinkedList(light);
  37. coreTestList(light);
  38. coreTestMatrix();
  39. coreTestPlane();
  40. coreTestQuaternion();
  41. coreTestRandom(light);
  42. coreTestRingBuffer();
  43. coreTestSpinLock();
  44. coreTestUtility(light);
  45. coreTestVector();
  46. coreTestView();
  47. coreLogLevel = CORE_LOG_WARNING;
  48. CORE_LOG_DEBUG("You won't see this!");
  49. coreLogLevel = CORE_LOG_DEBUG;
  50. unsigned int data = 123456789;
  51. coreSetExitHandler(onExit, &data);
  52. CORE_EXIT(1);
  53. }