MCPcopy Create free account
hub / github.com/WheretIB/nullc / RunTests

Function RunTests

UnitTests.cpp:74–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74void 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();

Callers 2

WinMainFunction · 0.85
mainFunction · 0.85

Calls 15

nullcInitFunction · 0.85
nullcInitCustomAllocFunction · 0.85
RunInterfaceTestsFunction · 0.85
nullcInitFileModuleFunction · 0.85
nullcInitMathModuleFunction · 0.85
nullcInitVectorModuleFunction · 0.85
nullcInitRandomModuleFunction · 0.85
nullcInitGCModuleFunction · 0.85
nullcInitIOModuleFunction · 0.85
nullcInitCanvasModuleFunction · 0.85
nullcInitWindowModuleFunction · 0.85
CompileFileFunction · 0.85

Tested by

no test coverage detected