2013-04-16 23:57:53 -04:00
|
|
|
#include <test.h>
|
2013-04-16 23:57:27 -04:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <assert.h>
|
2013-04-16 23:57:30 -04:00
|
|
|
#include <string.h>
|
|
|
|
#include <unistd.h>
|
2013-04-16 23:57:27 -04:00
|
|
|
|
|
|
|
int verbose;
|
|
|
|
|
2013-04-16 23:57:53 -04:00
|
|
|
int test_main(int argc, char *argv[]) {
|
2013-04-16 23:57:27 -04:00
|
|
|
int i;
|
|
|
|
int n = 1;
|
|
|
|
|
|
|
|
for (i=1; i<argc; i++) {
|
|
|
|
char *arg = argv[i];
|
|
|
|
if (strcmp(arg, "-v") == 0 || strcmp(arg, "--verbose") == 0)
|
|
|
|
verbose++;
|
|
|
|
n = atoi(arg);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i=0; i<1000; i++) {
|
|
|
|
if (verbose) {
|
|
|
|
printf("usleep %d\n", i); fflush(stdout);
|
|
|
|
}
|
|
|
|
usleep(n);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|