12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- #include <locale.h>
- #include <string.h>
- #include "../src/ErrorSimulator.hpp"
- #include "Test.hpp"
- #include "Tests.hpp"
- #include "core/utils/ArrayString.hpp"
- #include "core/utils/Utility.hpp"
- static void onExit(int code, void* data) {
- unsigned int i = *static_cast<unsigned int*>(data);
- Core::String32<1024> s;
- CORE_TEST_ERROR(s.append("Hello from exit #: #"));
- CORE_TEST_ERROR(s.format(code, i));
- CORE_TEST_ERROR(s.printLine());
- Core::String8<64> s8;
- CORE_TEST_ERROR(s8.append("Hello from exit"));
- CORE_TEST_ERROR(s8.printLine());
- Core::Test::finalize();
- }
- int main(int argAmount, const char** args) {
- setlocale(LC_ALL, "en_US.utf8");
- bool light = false;
- bool outOfMemoryTest = true;
- for(int i = 0; i < argAmount; i++) {
- if(strcmp(args[i], "light") == 0) {
- light = true;
- } else if(strcmp(args[i], "valgrind") == 0) {
- outOfMemoryTest = false;
- }
- }
- Core::testArrayList(light);
- Core::testArrayString();
- Core::testArray();
- Core::testBitArray(outOfMemoryTest);
- Core::testBox();
- Core::testBuffer(light);
- Core::testBufferedValue();
- Core::testClock(light);
- Core::testColor();
- Core::testComponents(outOfMemoryTest);
- Core::testError();
- Core::testFileReader();
- Core::testFrustum();
- Core::testHashedString();
- Core::testHashMap(light, outOfMemoryTest);
- Core::testLinkedList(light, outOfMemoryTest);
- Core::testList(light);
- Core::testMath();
- Core::testMatrixStack(light);
- Core::testMatrix();
- Core::testNew();
- Core::testPlane();
- Core::testProbingHashMap(light, outOfMemoryTest);
- Core::testQuaternion();
- Core::testRandom(light);
- Core::testRingBuffer();
- Core::testStack(light);
- Core::testThread();
- Core::testUniquePointer();
- Core::testUtility();
- Core::testVector();
- Core::testView();
- Core::Logger::level = Core::Logger::Level::WARNING;
- CORE_LOG_DEBUG("You won't see this!");
- Core::Logger::level = Core::Logger::Level::DEBUG;
- unsigned int data = 123456789;
- Core::setExitHandler(onExit, &data);
- char buffer[] = {-100, 0};
- CORE_LOG_ERROR(buffer);
- return 0;
- }
|