diff options
Diffstat (limited to 'tests/lib/test_zlog.c')
| -rw-r--r-- | tests/lib/test_zlog.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/lib/test_zlog.c b/tests/lib/test_zlog.c index 790e65cfe9..48fa7bce94 100644 --- a/tests/lib/test_zlog.c +++ b/tests/lib/test_zlog.c @@ -20,6 +20,7 @@ #include <zebra.h> #include <memory.h> #include "log.h" +#include "network.h" /* maximum amount of data to hexdump */ #define MAXDATA 16384 @@ -34,12 +35,14 @@ static bool test_zlog_hexdump(void) unsigned int nl = 1; do { - long d[nl]; + uint8_t d[nl]; for (unsigned int i = 0; i < nl; i++) - d[i] = random(); - zlog_hexdump(d, nl * sizeof(long)); - } while (++nl * sizeof(long) <= MAXDATA); + d[i] = frr_weak_random(); + zlog_hexdump(d, nl - 1); + + nl += 1 + (nl / 2); + } while (nl <= MAXDATA); return true; } @@ -50,9 +53,7 @@ bool (*tests[])(void) = { int main(int argc, char **argv) { - openzlog("testzlog", "NONE", 0, LOG_CONS | LOG_NDELAY | LOG_PID, - LOG_ERR); - zlog_set_file("test_zlog.log", LOG_DEBUG); + zlog_aux_init("NONE: ", ZLOG_DISABLED); for (unsigned int i = 0; i < array_size(tests); i++) if (!tests[i]()) |
