Test: Add option to do invoke the dumper (decode all values)
static size_t NUM_THREADS = 0;
static size_t FILES_PER_ITERATION = 0;
static char* INPUT_FILE = NULL;
+int opt_dump = 0; /* If 1 then dump handle to /dev/null */
int opt_clone = 0; /* If 1 then clone source handle */
int opt_write = 0; /* If 1 write handle to file */
@@ -48,7 +49,7 @@ static int encode_file(char *template_file, char *output_file)
return 1;
}
}
- {
+ if (opt_dump) {
FILE *devnull = fopen("/dev/null", "w");
grib_dumper* dumper = NULL;
const char* dumper_name = "bufr_simple";
@@ -91,8 +92,9 @@ int main(int argc, char **argv)
return 1;
}
- while ((c = getopt (argc, argv, "cw")) != -1) {
+ while ((c = getopt (argc, argv, "dcw")) != -1) {
switch (c) {
+ case 'd': opt_dump=1; break;
case 'c': opt_clone=1; break;
case 'w': opt_write=1; break;
}
@@ -108,7 +110,7 @@ int main(int argc, char **argv)
}
if (parallel) {
printf("Running parallel in %ld threads. %ld iterations\n", NUM_THREADS, FILES_PER_ITERATION);
- printf("Options: clone=%d, write=%d\n", opt_clone, opt_write);
+ printf("Options: dump=%d, clone=%d, write=%d\n", opt_dump, opt_clone, opt_write);
} else {
printf("Running sequentially in %ld runs. %ld iterations\n", NUM_THREADS, FILES_PER_ITERATION);
}
