diff options
author | dzwdz | 2021-09-21 18:52:20 +0200 |
---|---|---|
committer | dzwdz | 2021-09-21 18:52:20 +0200 |
commit | ad81d4904ca9f710cf4d56de31eca994dc005844 (patch) | |
tree | a738b352dac7eea1001a1f8ee6a3ff7b6cb32990 /src/kernel/tests | |
parent | d9ec06192725bb6bf023120e99cbe8da33756628 (diff) |
start using sparse's `-Wnon-pointer-null`
While I personally don't see a reason to use NULL instead of 0, I assume
that whoever made that a sparse default knew what they were doing.
Diffstat (limited to 'src/kernel/tests')
-rw-r--r-- | src/kernel/tests/vfs.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/kernel/tests/vfs.c b/src/kernel/tests/vfs.c index 751192b..7591b0e 100644 --- a/src/kernel/tests/vfs.c +++ b/src/kernel/tests/vfs.c @@ -8,7 +8,7 @@ TEST(path_simplify) { #define TEST_WRAPPER(argument, result) do { \ int len = path_simplify(argument, buf, sizeof(argument) - 1); \ - if (result == 0) { \ + if (result == NULL) { \ TEST_COND(len < 0); \ } else { \ if (len == sizeof(result) - 1) { \ @@ -39,24 +39,24 @@ TEST(path_simplify) { TEST_WRAPPER("/asdf//.", "/asdf/"); // going under the root or close to it - TEST_WRAPPER("/..", 0); - TEST_WRAPPER("/../asdf", 0); - TEST_WRAPPER("/../asdf/", 0); - TEST_WRAPPER("/./a/../..", 0); + TEST_WRAPPER("/..", NULL); + TEST_WRAPPER("/../asdf", NULL); + TEST_WRAPPER("/../asdf/", NULL); + TEST_WRAPPER("/./a/../..", NULL); TEST_WRAPPER("/a/a/../..", "/"); TEST_WRAPPER("/a/../a/..", "/"); - TEST_WRAPPER("/a/../../a", 0); - TEST_WRAPPER("/../a/../a", 0); - TEST_WRAPPER("/../../a/a", 0); - TEST_WRAPPER("/////../..", 0); - TEST_WRAPPER("//a//../..", 0); + TEST_WRAPPER("/a/../../a", NULL); + TEST_WRAPPER("/../a/../a", NULL); + TEST_WRAPPER("/../../a/a", NULL); + TEST_WRAPPER("/////../..", NULL); + TEST_WRAPPER("//a//../..", NULL); // relative paths aren't allowed - TEST_WRAPPER("relative", 0); - TEST_WRAPPER("some/stuff", 0); - TEST_WRAPPER("./stuff", 0); - TEST_WRAPPER("../stuff", 0); - TEST_WRAPPER("", 0); + TEST_WRAPPER("relative", NULL); + TEST_WRAPPER("some/stuff", NULL); + TEST_WRAPPER("./stuff", NULL); + TEST_WRAPPER("../stuff", NULL); + TEST_WRAPPER("", NULL); #undef TEST_WRAPPER } |