summaryrefslogtreecommitdiff
path: root/test_json.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2012-09-07 06:02:53 -0400
committerEric S. Raymond <esr@thyrsus.com>2012-09-07 06:02:53 -0400
commit2240d9ca9f1b367ef985eef8a3a028936ac71f56 (patch)
tree3c9543b96e5eb24b35836942db7c508fc239a8da /test_json.c
parentc6e26279e448cb50d26aa308a1473a1d192b192a (diff)
downloadgpsd-2240d9ca9f1b367ef985eef8a3a028936ac71f56.tar.gz
Replace exit({0,1}) with exit(EXIT_{SUCCESS,FAILURE})
Note there are some exit(2) instances we bneed to decide what to do with.
Diffstat (limited to 'test_json.c')
-rw-r--r--test_json.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/test_json.c b/test_json.c
index 85059f83..7d63c049 100644
--- a/test_json.c
+++ b/test_json.c
@@ -20,7 +20,7 @@ static void assert_case(int num, int status)
if (status != 0) {
(void)fprintf(stderr, "case %d FAILED, status %d (%s).\n", num,
status, json_error_string(status));
- exit(1);
+ exit(EXIT_FAILURE);
}
}
@@ -30,7 +30,7 @@ static void assert_string(char *attr, char *fld, char *val)
(void)fprintf(stderr,
"'%s' string attribute eval failed, value = %s.\n",
attr, fld);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
@@ -40,7 +40,7 @@ static void assert_integer(char *attr, int fld, int val)
(void)fprintf(stderr,
"'%s' integer attribute eval failed, value = %d.\n",
attr, fld);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
@@ -50,7 +50,7 @@ static void assert_uinteger(char *attr, uint fld, uint val)
(void)fprintf(stderr,
"'%s' integer attribute eval failed, value = %u.\n",
attr, fld);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
@@ -61,7 +61,7 @@ static void assert_boolean(char *attr, bool fld, bool val)
(void)fprintf(stderr,
"'%s' boolean attribute eval failed, value = %s.\n",
attr, fld ? "true" : "false");
- exit(1);
+ exit(EXIT_FAILURE);
}
/*@+boolcompare@*/
}
@@ -76,7 +76,7 @@ static void assert_real(char *attr, double fld, double val)
(void)fprintf(stderr,
"'%s' real attribute eval failed, value = %f.\n", attr,
fld);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
@@ -228,7 +228,7 @@ int main(int argc UNUSED, char *argv[]UNUSED)
case 'h':
default:
(void)fputs("usage: test_json [-D lvl]\n", stderr);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
@@ -314,5 +314,5 @@ int main(int argc UNUSED, char *argv[]UNUSED)
(void)fprintf(stderr, "succeeded.\n");
- exit(0);
+ exit(EXIT_SUCCESS);
}