summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/util.c3
-rw-r--r--src/util.h3
-rw-r--r--tests/util.c14
3 files changed, 20 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index e7a3823..e295cb6 100644
--- a/src/util.c
+++ b/src/util.c
@@ -13,6 +13,9 @@
const size_t
NULL_TERMINATOR = sizeof((char)'\0');
+const int
+EXIT_USAGE = 2;
+
int
slurp(const char *const filename, char **out) {
int rc = -1;
diff --git a/src/util.h b/src/util.h
index ca6ba3f..f1bace9 100644
--- a/src/util.h
+++ b/src/util.h
@@ -1,6 +1,9 @@
extern const size_t
NULL_TERMINATOR;
+extern const int
+EXIT_USAGE;
+
int
slurp(const char *const filename, char **out);
diff --git a/tests/util.c b/tests/util.c
index 662ccc8..bda7606 100644
--- a/tests/util.c
+++ b/tests/util.c
@@ -6,6 +6,18 @@
#include "slurp.h"
+static void
+test_EXIT_USAGE(void) {
+ test_start("EXIT_USAGE");
+
+ {
+ testing("it is different that EXIT_SUCCESS and EXIT_FAILURE");
+ assert(EXIT_USAGE != EXIT_SUCCESS);
+ assert(EXIT_USAGE != EXIT_FAILURE);
+ test_ok();
+ }
+}
+
static int
test_slurp(void) {
int rc = -1;
@@ -99,6 +111,8 @@ int
main(void) {
int rc = -1;
+ test_EXIT_USAGE();
+
if (test_slurp()) {
logerr("test_slurp()");
goto out;