X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Ftest%2Ftest-util.c;h=05b2294e24cba588e3580e13f8c6af4564a9b473;hb=3022d74ba585f961de7015087cd95673705bee3c;hp=afc3247ffd11e055d25b10e86764eedc9f4cfb76;hpb=28383ba18963cdedd98ced271b3425f7321119b7;p=elogind.git diff --git a/src/test/test-util.c b/src/test/test-util.c index afc3247ff..05b2294e2 100644 --- a/src/test/test-util.c +++ b/src/test/test-util.c @@ -568,6 +568,16 @@ static void test_get_files_in_directory(void) { assert_se(get_files_in_directory(".", NULL) >= 0); } +static void test_in_set(void) { + assert_se(IN_SET(1, 1)); + assert_se(IN_SET(1, 1, 2, 3, 4)); + assert_se(IN_SET(2, 1, 2, 3, 4)); + assert_se(IN_SET(3, 1, 2, 3, 4)); + assert_se(IN_SET(4, 1, 2, 3, 4)); + assert_se(!IN_SET(0, 1)); + assert_se(!IN_SET(0, 1, 2, 3, 4)); +} + int main(int argc, char *argv[]) { test_streq_ptr(); test_first_word(); @@ -604,6 +614,7 @@ int main(int argc, char *argv[]) { test_split_pair(); test_fstab_node_to_udev_node(); test_get_files_in_directory(); + test_in_set(); return 0; }