blob: c7450eb68d1b207067679439c413fba039d120bd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#include "tests.h"
int main(int argc, char *argv[])
{
int i, test_ret;
if ((argc - 1) % (ARG_CNT + 1) || argc == 1) {
printf(
"usage: " SFUNC " <tests>\n"
"test: < <ret> " ARG_USE " >\n"
);
exit(1);
}
test_ret = 0;
i = 1;
while (i < argc) {
char *s;
s = argv[i++];
int ret = atoi(s);
process_args();
int actual_ret = (int)FUNC(FUNC_IMP);
printf("%s: " SFUNC "(" FUNC_STR ") = %i (wanted %i)\n",
(actual_ret == ret) ? "PASS" : "FAIL",
FUNC_IMP, actual_ret, ret);
if (actual_ret != ret) ++test_ret;
}
return test_ret;
}
|