50 lines
1.2 KiB
C++
50 lines
1.2 KiB
C++
#include <stdio.h>
|
|
#include "test.h"
|
|
|
|
//tests
|
|
int testFiles_parent();
|
|
int testFiles_file();
|
|
int testFiles_extention();
|
|
int testFiles_scan();
|
|
int testFiles_readFile();
|
|
|
|
int testUtil_Count();
|
|
int testUtil_equalsIgnoreCase();
|
|
int testUtil_toLower();
|
|
int testUtil_start_endWith();
|
|
int testUtil_removeStart_End();
|
|
int testUtil_insertStart_End();
|
|
int testUtil_trim();
|
|
int testUtil_base();
|
|
|
|
int testStringSpliterator();
|
|
int testUtilSplit();
|
|
|
|
int testGetDoy();
|
|
|
|
test_t tests[] = {testFiles_parent, testFiles_file, testFiles_extention, testFiles_scan, testFiles_readFile,
|
|
testUtil_Count, testUtil_equalsIgnoreCase, testUtil_toLower, testUtil_start_endWith, testUtil_removeStart_End, testUtil_insertStart_End, testUtil_trim, testUtil_base,
|
|
testStringSpliterator, testUtilSplit,
|
|
testGetDoy,
|
|
NULL};
|
|
|
|
int main(int argc, char** argv) {
|
|
|
|
test_t* current = tests;
|
|
int failcount = 0;
|
|
int testcount = 0;
|
|
for(; *current; current++) {
|
|
testcount++;
|
|
printf("\033[1mRunning test number: %02d ", testcount);
|
|
if((*current)()) {
|
|
printf("\033[1;92msucceeded\033[0;1m!\n");
|
|
} else {
|
|
printf("\033[1;91mfailed\033[0;1m\n");
|
|
failcount++;
|
|
}
|
|
}
|
|
|
|
printf("\033[1;93m%d\033[0;1m/%d failed\n", failcount, testcount);
|
|
return failcount > 0;
|
|
}
|