summaryrefslogtreecommitdiffstats
path: root/src/test/test-chase.c
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2023-06-02 11:00:48 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2023-06-06 14:42:03 +0200
commit3c8f449cc84c5c3f583841360271d927d5e384fc (patch)
treefb5a762bfa264c7c614bc3762105257fd1adf596 /src/test/test-chase.c
parenttest-chase: Fix comment (diff)
downloadsystemd-3c8f449cc84c5c3f583841360271d927d5e384fc.tar.xz
systemd-3c8f449cc84c5c3f583841360271d927d5e384fc.zip
chase: Allow passing NULL as the empty path to chaseat()
Per coding style, we should accept NULL as the empty path.
Diffstat (limited to 'src/test/test-chase.c')
-rw-r--r--src/test/test-chase.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/test-chase.c b/src/test/test-chase.c
index 5bbda2007b..c62a14a777 100644
--- a/src/test/test-chase.c
+++ b/src/test/test-chase.c
@@ -570,6 +570,10 @@ TEST(chaseat) {
assert_se(streq(result, "."));
result = mfree(result);
+ assert_se(chaseat(tfd, NULL, CHASE_PARENT|CHASE_AT_RESOLVE_IN_ROOT|CHASE_EXTRACT_FILENAME, &result, NULL) >= 0);
+ assert_se(streq(result, "."));
+ result = mfree(result);
+
/* Test chase_and_openat() */
fd = chase_and_openat(tfd, "o/p/e/n/f/i/l/e", CHASE_MKDIR_0755, O_CREAT|O_EXCL|O_CLOEXEC, NULL);