X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Ftest%2Ftest-path-util.c;h=527b27565693959b89405da5c3d36115aed9b577;hb=b972115c97b9ec1bb17ee4897da6b85d82727ca8;hp=bec2a836112693836f3851165d30171850f8901d;hpb=2b6bf07dd23bb467099d213c97b3875c5e453491;p=elogind.git diff --git a/src/test/test-path-util.c b/src/test/test-path-util.c index bec2a8361..527b27565 100644 --- a/src/test/test-path-util.c +++ b/src/test/test-path-util.c @@ -104,6 +104,8 @@ static void test_find_binary(void) { free(p); assert(find_binary("xxxx-xxxx", &p) == -ENOENT); + + assert(find_binary("/some/dir/xxxx-xxxx", &p) == -ENOENT); } static void test_prefixes(void) { @@ -158,9 +160,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; }