7 #pragma warning(disable : 4996) 22 #define CM_CAST(TYPE, EXPR) static_cast<TYPE>(EXPR) 24 #define CM_CAST(TYPE, EXPR) (TYPE)(EXPR) 38 "mitkColorSequenceRainbowTest",
46 "mitkMultiStepperTest",
50 "mitkUnstructuredGridTest",
54 "mitkCompressedImageContainerTest",
71 stringSize =
CM_CAST(
size_t, strlen(
string) + 1);
72 new_string =
CM_CAST(
char*, malloc(
sizeof(
char) * stringSize));
74 if (new_string == NULL) {
77 strcpy(new_string,
string);
78 for (p = new_string; *p != 0; ++p) {
79 *p =
CM_CAST(
char, tolower(*p));
84 int main(
int ac,
char* av[])
86 int i, testNum = 0, partial_match;
96 printf(
"Available tests:\n");
100 printf(
"To run a test, enter the test number: ");
102 if (scanf(
"%d", &testNum) != 1) {
103 printf(
"Couldn't parse that input as a number\n");
106 if (testNum >= NumTests) {
107 printf(
"%3d is an invalid test number.\n", testNum);
117 if (testToRun == -1 && ac > 1) {
118 partial_match = (strcmp(av[1],
"-R") == 0) ? 1 : 0;
120 if (partial_match != 0 && ac < 3) {
121 printf(
"-R needs an additional parameter.\n");
124 if (testToRun == -1) {
127 for (i = 0; i <
NumTests && testToRun == -1; ++i) {
129 if (partial_match != 0 && strstr(test_name, arg) != NULL) {
133 }
else if (partial_match == 0 && strcmp(test_name, arg) == 0) {
141 if (testToRun != -1) {
144 for (
int avIndex = 1; avIndex < ac; ++avIndex)
globalCmdLineArgs.push_back(av[avIndex]);
147 if (testToRun < 0 || testToRun >=
NumTests) {
148 printf(
"testToRun was modified by TestDriver code to an invalid value: " 159 printf(
"Available tests:\n");
163 printf(
"Failed: %s is an invalid test name.\n", av[1]);
int mitkColorSequenceRainbowTest(int, char *[])
static void Register()
registers MITK logging backend at mbilog
int mitkMeshTest(int, char *[])
int main(int ac, char *av[])
static functionMapEntry cmakeGeneratedFunctionMapEntries[]
int(* MainFuncPointer)(int, char *[])
int mitkMultiStepperTest(int, char *[])
#define CM_CAST(TYPE, EXPR)
static const int NumTests
static char * lowercase(const char *string)
static void Unregister()
Unregisters MITK logging backend at mbilog.
int mitkUnstructuredGridTest(int, char *[])
int mitkCompressedImageContainerTest(int, char *[])
ctest entry point
std::vector< std::string > globalCmdLineArgs