1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- #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::Test::finalize();
- }
- int main(int argAmount, const char** args) {
- 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::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;
- }
|