Add initial FnixLib development implementation
This commit is contained in:
commit
84742ae38e
33 files changed
+3340
No files matched your search
@@ -0,0 +1,26 @@
|
||||
/* Mini-arnés de pruebas: sin dependencias externas. */
|
||||
#ifndef FNIX_TEST_CHECK_H
|
||||
#define FNIX_TEST_CHECK_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
static int g_check_failures = 0;
|
||||
static int g_check_total = 0;
|
||||
|
||||
#define CHECK(cond) \
|
||||
do { \
|
||||
g_check_total++; \
|
||||
if (!(cond)) { \
|
||||
g_check_failures++; \
|
||||
fprintf(stderr, "%s:%d: CHECK fallido: %s\n", __FILE__, __LINE__, \
|
||||
#cond); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* Imprime el resumen y devuelve el código de salida del programa. */
|
||||
#define CHECK_REPORT(name) \
|
||||
(printf("%s: %d comprobaciones, %d fallos\n", (name), g_check_total, \
|
||||
g_check_failures), \
|
||||
g_check_failures == 0 ? 0 : 1)
|
||||
|
||||
#endif /* FNIX_TEST_CHECK_H */
|
||||
Reference in new issue
Block a user