X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Ftest%2Ftest-path-util.c;h=a2cf0af75fef675774444ced03a7f49c81acb0b2;hp=bec2a836112693836f3851165d30171850f8901d;hb=eb66db55fc4b342e4253065886e0cc0419c45a07;hpb=b189101727e80a09864c5e5880663ef565467f19 diff --git a/src/test/test-path-util.c b/src/test/test-path-util.c index bec2a8361..a2cf0af75 100644 --- a/src/test/test-path-util.c +++ b/src/test/test-path-util.c @@ -158,9 +158,20 @@ static void test_prefixes(void) { } } +static void test_fsck_exists(void) { + /* Ensure we use a sane default for PATH. */ + unsetenv("PATH"); + + /* fsck.minix is provided by util-linux and will probably exist. */ + assert_se(fsck_exists("minix") == 0); + + assert_se(fsck_exists("AbCdE") == -ENOENT); +} + int main(void) { test_path(); test_find_binary(); test_prefixes(); + test_fsck_exists(); return 0; }