Main.c 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #include <locale.h>
  2. #include <string.h>
  3. // #include "../src/ErrorSimulator.hpp"
  4. #include "Test.h"
  5. #include "Tests.h"
  6. #include "core/utils/Logger.h"
  7. // #include "core/utils/ArrayString.hpp"
  8. // #include "core/utils/Utility.hpp"
  9. /*static void onExit(int code, void* data) {
  10. unsigned int i = *static_cast<unsigned int*>(data);
  11. Core::ArrayString<1024> s;
  12. s.append("Hello from exit #: #");
  13. s.format(code, i);
  14. s.printLine();
  15. Core::print('A');
  16. Core::Test::finalize();
  17. }*/
  18. int main(int argAmount, const char** args) {
  19. setlocale(LC_ALL, "en_US.utf8");
  20. bool light = false;
  21. for(int i = 0; i < argAmount; i++) {
  22. if(strcmp(args[i], "light") == 0) {
  23. light = true;
  24. }
  25. }
  26. (void)light;
  27. CORE_TEST_INT(20, 30);
  28. CORE_TEST_INT(20, 20);
  29. CORE_TEST_INT(20, 40);
  30. CORE_TEST_INT(20, 50);
  31. CORE_TEST_BOOL(true, false);
  32. CORE_TEST_TRUE(true);
  33. CORE_TEST_FALSE(false);
  34. CORE_TEST_TRUE(false);
  35. CORE_TEST_NULL(nullptr);
  36. CORE_TEST_NOT_NULL(nullptr);
  37. CORE_TEST_FLOAT(0, 3, 1);
  38. CORE_TEST_STRING("wusi", "GUSI");
  39. CORE_TEST_STRING("wusi", "wusi");
  40. Test_finalize();
  41. CORE_LOG_DEBUG("This is a test %d", 6);
  42. CORE_LOG_INFO("This is a test");
  43. CORE_LOG_WARNING("This is a test");
  44. CORE_LOG_ERROR("This is a test");
  45. /*
  46. Core::testArrayList(light);
  47. Core::testArrayString();
  48. Core::testArray();
  49. Core::testBitArray();
  50. Core::testBox();
  51. Core::testBuffer(light);
  52. Core::testBufferedValue();
  53. Core::testClock(light);
  54. Core::testColor();
  55. Core::testComponents();
  56. Core::testError();
  57. Core::testFileReader();
  58. Core::testFrustum();
  59. Core::testHashedString();
  60. Core::testHashMap(light);
  61. Core::testLinkedList(light);
  62. Core::testList(light);
  63. Core::testMath();
  64. Core::testMatrixStack(light);
  65. Core::testMatrix();
  66. Core::testNew();
  67. Core::testPlane();
  68. Core::testQuaternion();
  69. Core::testRandom(light);
  70. Core::testRingBuffer();
  71. Core::testStack(light);
  72. Core::testThread();
  73. Core::testUniquePointer();
  74. Core::testUtility();
  75. Core::testVector();
  76. Core::testView();*/
  77. logLevel = LOG_LEVEL_WARNING;
  78. CORE_LOG_DEBUG("You won't see this!");
  79. logLevel = LOG_LEVEL_DEBUG;
  80. // unsigned int data = 123456789;
  81. // Core::setExitHandler(onExit, &data);
  82. // CORE_EXIT(1);
  83. return 0;
  84. }