/
githubmirror
/
procps
Обзор
Документация
Войти
/
githubmirror
/
procps
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v4.0.0
include/tests.h
28 строк
560 B
Jim Warner
build-sys: fix some important 'tests.h' related issues
17 авг 2020, 14:49
17 авг 2020, 14:49
2c89119
Код
Авторство
О чём код?
#ifndef PROCPS_NG_TESTS_H #define PROCPS_NG_TESTS_H #include <stdio.h> typedef int (*TestFunction)(void *data); char *testname; static inline int run_tests(TestFunction *list, void *data) { int i; TestFunction current; for (i=0; list[i] != NULL; i++) { testname = NULL; current = list[i]; if (!current(data)) { fprintf(stderr, "FAIL: %s\n", testname); return EXIT_FAILURE; } else { fprintf(stderr, "PASS: %s\n", testname); } } return EXIT_SUCCESS; } #endif