Commit 9d46b017 authored by Matthias Braun's avatar Matthias Braun
Browse files

make XXEndless only run endless when parameters are passed, cleanup some tests, add a new test

parent f87e27ed
......@@ -51,11 +51,11 @@ static void me3(int num) {
int main(int argc, char *argv[]) {
printf("XXEndless.c\n");
if (argc != 2) {
printf("\nUsage: Endless n, where n determines the loop.\n");
printf("Continuing with default input.\n");
quiet = 1;
printf("\nUsage: Endless n, where n determines the loop.\n");
printf("Continuing with default input.\n");
return 0;
} else {
loop = atoi(argv[1]);
loop = atoi(argv[1]);
quiet = 0;
}
me1(loop);
......
......@@ -52,17 +52,17 @@ int main ()
gd[i] = i, gf[i] = i;
}
//foo (1);
foo (1);
for (i = 0; i < 32; i++) {
if (gd[i] != i * 4) {
printf("abort1 (%d) expected %d, got %f\n", i, i*4, gd[i]);
abort ();
}
if(gf[i] != i) {
printf("abort2 (%d)\n", i);
printf("abort1 (%d) expected %d, got %f\n", i, i, gf[i]);
abort();
}
if (gd[i] != i * 4) {
printf("abort2 (%d) expected %d, got %f\n", i, i*4, gd[i]);
abort ();
}
}
exit (0);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment