Main.cpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #include <string.h>
  2. #include "../src/ErrorSimulator.hpp"
  3. #include "Test.hpp"
  4. #include "Tests.hpp"
  5. #include "core/utils/ArrayString.hpp"
  6. #include "core/utils/Utility.hpp"
  7. static void onExit(int code, void* data) {
  8. unsigned int i = *static_cast<unsigned int*>(data);
  9. Core::String32<1024> s;
  10. CORE_TEST_ERROR(s.append("Hello from exit #: #"));
  11. CORE_TEST_ERROR(s.format(code, i));
  12. CORE_TEST_ERROR(s.printLine());
  13. Core::Test::finalize();
  14. }
  15. int main(int argAmount, const char** args) {
  16. bool light = false;
  17. bool outOfMemoryTest = true;
  18. for(int i = 0; i < argAmount; i++) {
  19. if(strcmp(args[i], "light") == 0) {
  20. light = true;
  21. } else if(strcmp(args[i], "valgrind") == 0) {
  22. outOfMemoryTest = false;
  23. }
  24. }
  25. Core::testArrayList(light);
  26. Core::testArrayString();
  27. Core::testArray();
  28. Core::testBitArray(outOfMemoryTest);
  29. Core::testBox();
  30. Core::testBuffer(light);
  31. Core::testBufferedValue();
  32. Core::testClock(light);
  33. Core::testColor();
  34. Core::testComponents(outOfMemoryTest);
  35. Core::testError();
  36. Core::testFileReader();
  37. Core::testFrustum();
  38. Core::testHashMap(light, outOfMemoryTest);
  39. Core::testLinkedList(light, outOfMemoryTest);
  40. Core::testList(light);
  41. Core::testMath();
  42. Core::testMatrixStack(light);
  43. Core::testMatrix();
  44. Core::testNew();
  45. Core::testPlane();
  46. Core::testProbingHashMap(light, outOfMemoryTest);
  47. Core::testQuaternion();
  48. Core::testRandom(light);
  49. Core::testRingBuffer();
  50. Core::testStack(light);
  51. Core::testThread();
  52. Core::testUniquePointer();
  53. Core::testUtility();
  54. Core::testVector();
  55. Core::testView();
  56. Core::Logger::level = Core::Logger::Level::WARNING;
  57. CORE_LOG_DEBUG("You won't see this!");
  58. Core::Logger::level = Core::Logger::Level::DEBUG;
  59. unsigned int data = 123456789;
  60. Core::setExitHandler(onExit, &data);
  61. char buffer[] = {-100, 0};
  62. CORE_LOG_ERROR(buffer);
  63. return 0;
  64. }