X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Ftest%2Ftest-util.c;h=7fd0572bcb1feb59e539c7d809cd9fe9ea6da30c;hb=872c8faaf2009422a91d227ae0b5c6f04c9d2c69;hp=ad13d53de35e5f1a22ea089386940b50e43d7dac;hpb=22f5f6281fc25f43a85938e9dad2480b2595c471;p=elogind.git diff --git a/src/test/test-util.c b/src/test/test-util.c index ad13d53de..7fd0572bc 100644 --- a/src/test/test-util.c +++ b/src/test/test-util.c @@ -27,6 +27,7 @@ #include #include "util.h" +#include "strv.h" static void test_streq_ptr(void) { assert_se(streq_ptr(NULL, NULL)); @@ -582,6 +583,14 @@ static void test_fstab_node_to_udev_node(void) { free(n); } +static void test_get_files_in_directory(void) { + _cleanup_strv_free_ char **l = NULL, **t = NULL; + + assert_se(get_files_in_directory("/tmp", &l) >= 0); + assert_se(get_files_in_directory(".", &t) >= 0); + assert_se(get_files_in_directory(".", NULL) >= 0); +} + int main(int argc, char *argv[]) { test_streq_ptr(); test_first_word(); @@ -618,6 +627,7 @@ int main(int argc, char *argv[]) { test_parse_user_at_host(); test_split_pair(); test_fstab_node_to_udev_node(); + test_get_files_in_directory(); return 0; }