tests: Correcting exit codes
authorJosé Bollo <jose.bollo@open.eurogiciel.org>
Wed, 12 Feb 2014 17:01:48 +0000 (18:01 +0100)
committerJosé Bollo <jose.bollo@open.eurogiciel.org>
Fri, 14 Feb 2014 14:33:10 +0000 (15:33 +0100)
The valid exit code are form 0 to 255. Then using -1 means that the
effective exit code will be 0377==255. It isn't accurate. The exit code
of 1 is merely very often used for failure status.

Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
tests/generator.c

index 7571b2e..ac1871c 100644 (file)
@@ -127,7 +127,7 @@ int pick_subj_label(struct label *labels, int nlab, int max_reoccurance)
                idx %= nlab;
                if (repeat > nlab) {
                        fprintf(stderr, "Wrong parameters");
-                       exit(-1);
+                       exit(1);
                }
        }
        return idx;
@@ -151,7 +151,7 @@ int pick_obj_label(struct label *labels, int nlab, int max_reoccurance, int *sub
                        repeat_subj++;
                        if (repeat_subj > nlab) {
                                fprintf(stderr, "Wrong parameters");
-                               exit(-1);
+                               exit(1);
                        } else
                                repeat = 0;
                }