7 #pragma warning(disable : 4996) 19 #define CM_CAST(TYPE, EXPR) static_cast<TYPE>(EXPR) 21 #define CM_CAST(TYPE, EXPR) (TYPE)(EXPR) 35 "mitkPropertySerializationTest",
39 "mitkVectorPropertySerializerTest",
56 stringSize =
CM_CAST(
size_t, strlen(
string) + 1);
57 new_string =
CM_CAST(
char*, malloc(
sizeof(
char) * stringSize));
59 if (new_string == NULL) {
62 strcpy(new_string,
string);
63 for (p = new_string; *p != 0; ++p) {
64 *p =
CM_CAST(
char, tolower(*p));
69 int main(
int ac,
char* av[])
71 int i, testNum = 0, partial_match;
81 printf(
"Available tests:\n");
85 printf(
"To run a test, enter the test number: ");
87 if (scanf(
"%d", &testNum) != 1) {
88 printf(
"Couldn't parse that input as a number\n");
91 if (testNum >= NumTests) {
92 printf(
"%3d is an invalid test number.\n", testNum);
102 if (testToRun == -1 && ac > 1) {
103 partial_match = (strcmp(av[1],
"-R") == 0) ? 1 : 0;
105 if (partial_match != 0 && ac < 3) {
106 printf(
"-R needs an additional parameter.\n");
109 if (testToRun == -1) {
112 for (i = 0; i <
NumTests && testToRun == -1; ++i) {
114 if (partial_match != 0 && strstr(test_name, arg) != NULL) {
118 }
else if (partial_match == 0 && strcmp(test_name, arg) == 0) {
126 if (testToRun != -1) {
129 for (
int avIndex = 1; avIndex < ac; ++avIndex)
globalCmdLineArgs.push_back(av[avIndex]);
132 if (testToRun < 0 || testToRun >=
NumTests) {
133 printf(
"testToRun was modified by TestDriver code to an invalid value: " 144 printf(
"Available tests:\n");
148 printf(
"Failed: %s is an invalid test name.\n", av[1]);
static void Register()
registers MITK logging backend at mbilog
int mitkPropertySerializationTest(int, char *[])
Test for all PropertySerializer classes.
int mitkVectorPropertySerializerTest(int, char *[])
#define CM_CAST(TYPE, EXPR)
int(* MainFuncPointer)(int, char *[])
static const int NumTests
static functionMapEntry cmakeGeneratedFunctionMapEntries[]
int main(int ac, char *av[])
static char * lowercase(const char *string)
static void Unregister()
Unregisters MITK logging backend at mbilog.
std::vector< std::string > globalCmdLineArgs