summaryrefslogtreecommitdiff
path: root/tests/testing.c
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-04-06 11:37:04 -0300
committerEuAndreh <eu@euandre.org>2024-04-06 11:37:04 -0300
commit3b32f5a1abbec9655a93a184ed0a3c5e6e5134fd (patch)
tree03969b7b76835f2507ccd1a8aeb057bb1d7f7201 /tests/testing.c
parentsrc/: Remove unused "infallible" tag (diff)
downloadpindaiba-3b32f5a1abbec9655a93a184ed0a3c5e6e5134fd.tar.gz
pindaiba-3b32f5a1abbec9655a93a184ed0a3c5e6e5134fd.tar.xz
Start "rc = -1" instead of 0
Diffstat (limited to 'tests/testing.c')
-rw-r--r--tests/testing.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/testing.c b/tests/testing.c
index 65012f9..eeb0a39 100644
--- a/tests/testing.c
+++ b/tests/testing.c
@@ -3,14 +3,13 @@
int
main(void) {
- int rc = 0;
+ int rc = -1;
test_start("testing.c");
const int should_overwrite = 1;
if (unsetenv(ENVVAR_NAME)) {
perror("unsetenv(\"NO_COLOR\")");
- rc = -1;
goto out;
}
{
@@ -20,7 +19,6 @@ main(void) {
if (setenv(ENVVAR_NAME, "", should_overwrite)) {
perror("setenv(\"NO_COLOR\", \"\", 1)");
- rc = -1;
goto out;
}
{
@@ -30,7 +28,6 @@ main(void) {
if (setenv(ENVVAR_NAME, "something", should_overwrite)) {
perror("setenv(\"NO_COLOR\", \"something\", 1)");
- rc = -1;
goto out;
}
{
@@ -38,6 +35,7 @@ main(void) {
test_ok();
}
+ rc = 0;
out:
return !!rc;
}