From 2b236af9b7f21b81df9ded062921da6cc3f37eb9 Mon Sep 17 00:00:00 2001 From: Bryce Harrington Date: Mon, 7 Dec 2015 22:49:14 -0800 Subject: [PATCH] socket-test: Refactor if check into the assert Signed-off-by: Bryce Harrington --- tests/socket-test.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/socket-test.c b/tests/socket-test.c index 2e336fdc..bb034f43 100644 --- a/tests/socket-test.c +++ b/tests/socket-test.c @@ -47,8 +47,7 @@ static const char * require_xdg_runtime_dir(void) { char *val = getenv("XDG_RUNTIME_DIR"); - if (!val) - assert(0 && "set $XDG_RUNTIME_DIR to run this test"); + assert(val && "set $XDG_RUNTIME_DIR to run this test"); return val; }