From bc3013fc68746265db78bf92623f7e6e3e469264 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Sun, 16 May 2021 21:06:48 -0400 Subject: Add default path (#6) * Add default path * Improve support/implementation logic * Fix braces in tests * Enable warnings * Emit more generalized form of windows path * Change initialization order * Add --default/-D to documentation * Fix platform detection --- tests/test_errors.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/test_errors.c') diff --git a/tests/test_errors.c b/tests/test_errors.c index 82241ed..18c444e 100644 --- a/tests/test_errors.c +++ b/tests/test_errors.c @@ -6,6 +6,8 @@ int main() { path = NULL; //intentionally bad - myassert(cleanpath_init("good", NULL) == NULL, "cleanpath_init() returned non-NULL on NULL sep\n"); - myassert(cleanpath_init(NULL, "good") == NULL, "cleanpath_init() returned non-NULL on NULL path\n"); + myassert((path = cleanpath_init("good", NULL)) == NULL, "cleanpath_init() returned non-NULL on NULL sep\n"); + if (path) cleanpath_free(path); + myassert((path = cleanpath_init(NULL, "good")) == NULL, "cleanpath_init() returned non-NULL on NULL path\n"); + if (path) cleanpath_free(path); } -- cgit