7 #pragma warning(disable : 4996) 17 #define CM_CAST(TYPE, EXPR) static_cast<TYPE>(EXPR) 19 #define CM_CAST(TYPE, EXPR) (TYPE)(EXPR) 46 stringSize =
CM_CAST(
size_t, strlen(
string) + 1);
47 new_string =
CM_CAST(
char*, malloc(
sizeof(
char) * stringSize));
49 if (new_string == NULL) {
52 strcpy(new_string,
string);
53 for (p = new_string; *p != 0; ++p) {
54 *p =
CM_CAST(
char, tolower(*p));
59 int main(
int ac,
char* av[])
61 int i, testNum = 0, partial_match;
71 printf(
"Available tests:\n");
75 printf(
"To run a test, enter the test number: ");
77 if (scanf(
"%d", &testNum) != 1) {
78 printf(
"Couldn't parse that input as a number\n");
81 if (testNum >= NumTests) {
82 printf(
"%3d is an invalid test number.\n", testNum);
92 if (testToRun == -1 && ac > 1) {
93 partial_match = (strcmp(av[1],
"-R") == 0) ? 1 : 0;
95 if (partial_match != 0 && ac < 3) {
96 printf(
"-R needs an additional parameter.\n");
99 if (testToRun == -1) {
102 for (i = 0; i <
NumTests && testToRun == -1; ++i) {
104 if (partial_match != 0 && strstr(test_name, arg) != NULL) {
108 }
else if (partial_match == 0 && strcmp(test_name, arg) == 0) {
116 if (testToRun != -1) {
119 for (
int avIndex = 1; avIndex < ac; ++avIndex)
globalCmdLineArgs.push_back(av[avIndex]);
122 if (testToRun < 0 || testToRun >=
NumTests) {
123 printf(
"testToRun was modified by TestDriver code to an invalid value: " 134 printf(
"Available tests:\n");
138 printf(
"Failed: %s is an invalid test name.\n", av[1]);
static const int NumTests
static void Register()
registers MITK logging backend at mbilog
static functionMapEntry cmakeGeneratedFunctionMapEntries[]
int main(int ac, char *av[])
#define CM_CAST(TYPE, EXPR)
int(* MainFuncPointer)(int, char *[])
static char * lowercase(const char *string)
static void Unregister()
Unregisters MITK logging backend at mbilog.
std::vector< std::string > globalCmdLineArgs