aboutsummaryrefslogtreecommitdiff
path: root/tests/test_errors.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2021-05-16 21:06:48 -0400
committerGitHub <noreply@github.com>2021-05-16 21:06:48 -0400
commitbc3013fc68746265db78bf92623f7e6e3e469264 (patch)
treefadf9d7fb0febde598dbc4a7b5ec27eea62020cc /tests/test_errors.c
parent25493db89f8e23d2e78e1ee16b3748173ef60188 (diff)
downloadcleanpath-bc3013fc68746265db78bf92623f7e6e3e469264.tar.gz
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
Diffstat (limited to 'tests/test_errors.c')
-rw-r--r--tests/test_errors.c6
1 files changed, 4 insertions, 2 deletions
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);
}