aboutsummaryrefslogtreecommitdiff
path: root/tests/test_utils.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2026-04-28 11:45:10 -0400
committerGitHub <noreply@github.com>2026-04-28 11:45:10 -0400
commit10f13b36560c5112554c54d8958081b7aa518050 (patch)
treebd27866c4352de38ebc5b13f8208768d576ae904 /tests/test_utils.c
parent017bc273aedf3f20512beeb78a2f513913e56305 (diff)
parentd761cc976a8d645e61d23f6e43dcfec1a7fdb061 (diff)
downloadstasis-10f13b36560c5112554c54d8958081b7aa518050.tar.gz
Merge pull request #137 from jhunkeler/bughunt-1001
Bug Hunt 0x1001
Diffstat (limited to 'tests/test_utils.c')
-rw-r--r--tests/test_utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/test_utils.c b/tests/test_utils.c
index a5faf5c..fd398e2 100644
--- a/tests/test_utils.c
+++ b/tests/test_utils.c
@@ -71,6 +71,8 @@ void test_fix_tox_conf() {
}
char **lines = file_readlines(result, 0, 0, NULL);
+ STASIS_ASSERT_FATAL(lines != NULL, "lines array should not be NULL");
+ STASIS_ASSERT_FATAL(result != NULL, "result should not be NULL");
STASIS_ASSERT(strstr_array(lines, expected) != NULL, "{posargs} not found in result");
guard_array_free(lines);
@@ -312,6 +314,7 @@ void test_path_dirname() {
const char *expected = data[i + 1];
char tmp[PATH_MAX] = {0};
strncpy(tmp, input, sizeof(tmp) - 1);
+ tmp[sizeof(tmp) - 1] = '\0';
char *result = path_dirname(tmp);
STASIS_ASSERT(strcmp(expected, result) == 0, NULL);