summaryrefslogtreecommitdiffstats
path: root/test/testframe.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/testframe.c')
-rw-r--r--test/testframe.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/test/testframe.c b/test/testframe.c
index af6e975..2dd181b 100644
--- a/test/testframe.c
+++ b/test/testframe.c
@@ -67,6 +67,8 @@ static int (*TestPrivateParser)(int ac, char *av[]) = NULL;
* TheDescr--Long description of the test.
* Parameters--pointer to extra parameters. Use NULL if none used.
* Since only the pointer is copied, the contents should not change.
+ * Return: Void
+ * exit EXIT_FAILURE if error is encountered.
*/
void
AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), const char *TheDescr, const void *Parameters)
@@ -75,17 +77,17 @@ AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), con
if (Index >= MAXNUMOFTESTS) {
printf("Too many tests added, increase MAXNUMOFTESTS(%d).\n",
MAXNUMOFTESTS);
- exit(-1);
+ exit(EXIT_FAILURE);
} /* end if */
if (HDstrlen(TheDescr) >= MAXTESTDESC) {
printf("Test description too long, increase MAXTESTDESC(%d).\n",
MAXTESTDESC);
- exit(-1);
+ exit(EXIT_FAILURE);
} /* end if */
if (HDstrlen(TheName) >= MAXTESTNAME) {
printf("Test name too long, increase MAXTESTNAME(%d).\n",
MAXTESTNAME);
- exit(-1);
+ exit(EXIT_FAILURE);
} /* end if */
/* Set up test function */
@@ -203,6 +205,9 @@ void TestInfo(const char *ProgName)
* Parse command line information.
* argc, argv: the usual command line argument count and strings
*
+ * Return: Void
+ * exit EXIT_FAILURE if error is encountered.
+ *
* Modification:
* 2004/08/18 Albert Cheng. Add extra_parse feature.
*/
@@ -218,7 +223,7 @@ void TestParseCmdLine(int argc, char *argv[])
ParseTestVerbosity(*argv);
}else{
TestUsage();
- exit(1);
+ exit(EXIT_FAILURE);
}
}
else if (((HDstrcmp(*argv, "-exclude") == 0) ||
@@ -228,7 +233,7 @@ void TestParseCmdLine(int argc, char *argv[])
SetTest(*argv, SKIPTEST);
}else{
TestUsage();
- exit(1);
+ exit(EXIT_FAILURE);
}
}
else if (((HDstrcmp(*argv, "-begin") == 0) ||
@@ -238,7 +243,7 @@ void TestParseCmdLine(int argc, char *argv[])
SetTest(*argv, BEGINTEST);
}else{
TestUsage();
- exit(1);
+ exit(EXIT_FAILURE);
}
}
else if (((HDstrcmp(*argv, "-only") == 0) ||
@@ -252,14 +257,14 @@ void TestParseCmdLine(int argc, char *argv[])
SetTest(*argv, ONLYTEST);
}else{
TestUsage();
- exit(1);
+ exit(EXIT_FAILURE);
}
}
else if ((HDstrcmp(*argv, "-summary") == 0) || (HDstrcmp(*argv, "-s") == 0))
Summary = 1;
else if ((HDstrcmp(*argv, "-help") == 0) || (HDstrcmp(*argv, "-h") == 0)) {
TestUsage();
- exit(0);
+ exit(EXIT_SUCCESS);
}
else if ((HDstrcmp(*argv, "-cleanoff") == 0) || (HDstrcmp(*argv, "-c") == 0))
SetTestNoCleanup();
@@ -274,7 +279,7 @@ void TestParseCmdLine(int argc, char *argv[])
if (NULL != TestPrivateParser){
ret_code=TestPrivateParser(argc+1, argv-1);
if (ret_code != 0)
- exit(-1);
+ exit(EXIT_FAILURE);
}
}