}
}
-static void handle_suite(const char *filename, FILE * IN)
+static void handle_suite(const char *filename, FILE * FICIN)
{
size_t len;
int blankline;
buff = xbt_strbuff_new();
rctx = rctx_new();
- while (getline(&line, &len, IN) != -1) {
+ while (getline(&line, &len, FICIN) != -1) {
line_num++;
/* Count the line length while checking wheather it's blank */
int main(int argc, char *argv[])
{
- FILE *IN = NULL;
+ FILE *FICIN = NULL;
int i;
char *suitename = NULL;
+ struct sigaction newact;
+
+ xbt_init(&argc, argv);
+ rctx_init();
+ parse_environ();
/* Ignore pipe issues.
They will show up when we try to send data to dead buddies,
but we will stop doing so when we're done with provided input */
- struct sigaction newact;
memset(&newact, 0, sizeof(newact));
newact.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &newact, NULL);
- xbt_init(&argc, argv);
- rctx_init();
- parse_environ();
-
/* Get args */
for (i = 1; i < argc; i++) {
if (!strcmp(argv[i], "--cd")) {
exit(1);
}
INFO1("Change directory to %s", argv[i + 1]);
- memmove(argv + i, argv + i + 2, (argc - i - 1)*sizeof(char*));
+ memmove(argv + i, argv + i + 2, (argc - i - 1) * sizeof(char *));
argc -= 2;
i -= 2;
}
INFO1("Test suite `%s'", suitename);
testsuite_name = suitename;
- IN = fopen(argv[i], "r");
- if (!IN) {
+ FICIN = fopen(argv[i], "r");
+ if (!FICIN) {
perror(bprintf("Impossible to open the suite file `%s'", argv[i]));
ERROR1("Test suite `%s': NOK (system error)", testsuite_name);
rctx_armageddon(rctx, 1);
}
- handle_suite(suitename, IN);
+ handle_suite(suitename, FICIN);
rctx_wait_bg();
- fclose(IN);
+ fclose(FICIN);
INFO1("Test suite `%s' OK", suitename);
free(suitename);
}
}
rctx_exit();
+ xbt_dict_free(&env);
return 0;
}