1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- #include <locale.h>
- #include <stdio.h>
- #include <string.h>
- #include "Tests.h"
- #include "core/Logger.h"
- #include "core/Test.h"
- #include "core/Utility.h"
- static void onExit(int code, void* data) {
- unsigned int i = *(unsigned int*)(data);
- LOG_WARNING("Hello from exit %d: %u", code, i);
- finalizeTests();
- printMemoryReport();
- }
- int main(int argAmount, const char** args) {
- setlocale(LC_ALL, "en_US.utf8");
- bool light = false;
- for(int i = 0; i < argAmount; i++) {
- if(strcmp(args[i], "light") == 0) {
- light = true;
- } else if(strcmp(args[i], "alloc") == 0) {
- testInvalidAllocate();
- } else if(strcmp(args[i], "realloc") == 0) {
- testInvalidReallocate();
- } else if(strcmp(args[i], "pre_canary") == 0) {
- testPreCanary();
- } else if(strcmp(args[i], "post_canary") == 0) {
- testPostCanary();
- } else if(strcmp(args[i], "test") == 0) {
- testTest();
- return 0;
- }
- }
- testBitArray();
- testBox();
- testBuffer(light);
- testComponents();
- testFrustum();
- testHashMap(light);
- testList(light);
- testMatrix();
- testPlane();
- testQuaternion();
- testQueue();
- testRandom(light);
- logLevel = LOG_NONE;
- testReadLine();
- logLevel = LOG_DEBUG;
- testSpinLock();
- testUtility(light);
- testVector();
- testView();
- logLevel = LOG_WARNING;
- LOG_DEBUG("You won't see this!");
- logLevel = LOG_DEBUG;
- unsigned int data = 123456789;
- setExitHandler(onExit, &data);
- EXIT(1);
- }
|