From e140f3cf8e000b2e63de9f2ec521d2d1542bc73f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Mon, 30 Oct 2023 08:45:44 +0100 Subject: [PATCH] tests: check that environment variable "HOME" is set before using it --- tests/unit/core/test-core-string.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/unit/core/test-core-string.cpp b/tests/unit/core/test-core-string.cpp index 11a742161..fb1828415 100644 --- a/tests/unit/core/test-core-string.cpp +++ b/tests/unit/core/test-core-string.cpp @@ -903,6 +903,7 @@ TEST(CoreString, ExpandHome) int length_home; home = getenv ("HOME"); + CHECK(home); length_home = strlen (home); POINTERS_EQUAL(NULL, string_expand_home (NULL)); @@ -927,6 +928,7 @@ TEST(CoreString, EvalPathHome) struct t_hashtable *extra_vars, *options; home = getenv ("HOME"); + CHECK(home); length_home = strlen (home); length_weechat_config_dir = strlen (weechat_config_dir);