/
githubmirror
/
dbus-broker
Обзор
Документация
Войти
/
githubmirror
/
dbus-broker
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/util/test-dirwatch.c
51 строка
1 KB
David Rheinsberg
build: add SPDX annotations
30 июн 2026, 15:45
30 июн 2026, 15:45
0bca774
Код
Авторство
О чём код?
/* SPDX-License-Identifier: GPL-3.0-or-later */ /* SPDX-FileCopyrightText: D-Bus Broker Developers */ /* * Test Directory Watch */ #undef NDEBUG #include <c-stdaux.h> #include <stdlib.h> #include "util/dirwatch.h" static void test_basic(void) { int r, fd; /* test cleanup helper */ { _c_cleanup_(dirwatch_freep) _c_unused_ Dirwatch *dw1 = NULL, *dw2 = NULL; /* prevent 'unused variable' warning */ dw1 = NULL; r = dirwatch_new(&dw2); c_assert(!r); } /* test no-op dispatcher */ { _c_cleanup_(dirwatch_freep) Dirwatch *dw = NULL; r = dirwatch_new(&dw); c_assert(!r); fd = dirwatch_get_fd(dw); c_assert(fd >= 0); r = dirwatch_dispatch(dw); c_assert(!r); r = dirwatch_add(dw, "."); c_assert(!r); r = dirwatch_dispatch(dw); c_assert(!r); } } int main(int argc, char **argv) { test_basic(); return 0; }