| 72 | } |
| 73 | |
| 74 | void RunTests(bool verbose) |
| 75 | { |
| 76 | Tests::messageVerbose = verbose; |
| 77 | |
| 78 | // Extra tests |
| 79 | |
| 80 | // Safe sprintf test |
| 81 | { |
| 82 | testsCount[3]++; |
| 83 | |
| 84 | char buf[8]; |
| 85 | char *pos = buf + SafeSprintf(buf, 8, "this "); |
| 86 | pos += SafeSprintf(pos, 8 - int(pos - buf), "string is too long"); |
| 87 | if(memcmp(buf, "this st", 8) != 0) |
| 88 | printf("Safe sprintf test failed: string is incorrect\n"); |
| 89 | else if(pos != buf + 8) |
| 90 | printf("Safe sprintf test failed: iterator is incorrect\n"); |
| 91 | else |
| 92 | testsPassed[3]++; |
| 93 | } |
| 94 | |
| 95 | /* |
| 96 | unsigned int tStart = clock(); |
| 97 | for(unsigned int i = 0; i < 10000; i++) |
| 98 | { |
| 99 | nullcInit("Modules/"); |
| 100 | nullcTerminate(); |
| 101 | } |
| 102 | printf("Finished in %d\r\n", clock() - tStart); |
| 103 | */ |
| 104 | |
| 105 | // Init NULLC |
| 106 | #ifdef NO_CUSTOM_ALLOCATOR |
| 107 | nullcInit(MODULE_PATH); |
| 108 | #else |
| 109 | nullcInitCustomAlloc(testAlloc, testDealloc, MODULE_PATH); |
| 110 | #endif |
| 111 | //nullcSetFileReadHandler(TestFileLoad); |
| 112 | |
| 113 | nullcInitTypeinfoModule(); |
| 114 | nullcInitDynamicModule(); |
| 115 | RunInterfaceTests(); |
| 116 | |
| 117 | #ifdef NO_CUSTOM_ALLOCATOR |
| 118 | nullcInit(MODULE_PATH); |
| 119 | #else |
| 120 | nullcInitCustomAlloc(testAlloc, testDealloc, MODULE_PATH); |
| 121 | #endif |
| 122 | |
| 123 | nullcInitTypeinfoModule(); |
| 124 | nullcInitFileModule(); |
| 125 | nullcInitMathModule(); |
| 126 | nullcInitVectorModule(); |
| 127 | nullcInitRandomModule(); |
| 128 | nullcInitDynamicModule(); |
| 129 | nullcInitGCModule(); |
| 130 | |
| 131 | nullcInitIOModule(); |
no test coverage detected