diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/lib/test_checksum.c | 2 | ||||
| -rw-r--r-- | tests/lib/test_graph.c | 2 | ||||
| -rw-r--r-- | tests/lib/test_srcdest_table.c | 4 | ||||
| -rw-r--r-- | tests/lib/test_timer_performance.c | 4 |
4 files changed, 5 insertions, 7 deletions
diff --git a/tests/lib/test_checksum.c b/tests/lib/test_checksum.c index 3972f76763..13d35b0e99 100644 --- a/tests/lib/test_checksum.c +++ b/tests/lib/test_checksum.c @@ -506,7 +506,7 @@ int main(int argc, char **argv) printf("verify: lib failed\n"); if (ospfd != lib) { - printf("Mismatch in values at size %u\n" + printf("Mismatch in values at size %d\n" "ospfd: 0x%04x\tc0: %d\tc1: %d\tx: %d\ty: %d\n" "isisd: 0x%04x\tc0: %d\tc1: %d\tx: %d\ty: %d\n" "lib: 0x%04x\n", diff --git a/tests/lib/test_graph.c b/tests/lib/test_graph.c index f21f8b793c..2801c48bc5 100644 --- a/tests/lib/test_graph.c +++ b/tests/lib/test_graph.c @@ -46,7 +46,7 @@ int main(int argc, char **argv) /* create vertices */ for (unsigned int i = 0; i < NUMNODES; i++) { - snprintf(names[i], sizeof(names[i]), "%d", i); + snprintf(names[i], sizeof(names[i]), "%u", i); gn[i] = graph_new_node(g, names[i], NULL); } diff --git a/tests/lib/test_srcdest_table.c b/tests/lib/test_srcdest_table.c index 408f4e0581..04e85435d1 100644 --- a/tests/lib/test_srcdest_table.c +++ b/tests/lib/test_srcdest_table.c @@ -104,9 +104,7 @@ static unsigned int log_key(void *data) static int log_cmp(const void *a, const void *b) { - if (a == NULL && b != NULL) - return 0; - if (b == NULL && a != NULL) + if (a == NULL || b == NULL) return 0; return !memcmp(a, b, 2 * sizeof(struct prefix)); diff --git a/tests/lib/test_timer_performance.c b/tests/lib/test_timer_performance.c index f9a244e259..d5f4badc85 100644 --- a/tests/lib/test_timer_performance.c +++ b/tests/lib/test_timer_performance.c @@ -92,9 +92,9 @@ int main(int argc, char **argv) t_remove = 1000 * (tv_stop.tv_sec - tv_lap.tv_sec); t_remove += (tv_stop.tv_usec - tv_lap.tv_usec) / 1000; - printf("Scheduling %d random timers took %ld.%03ld seconds.\n", + printf("Scheduling %d random timers took %lu.%03lu seconds.\n", SCHEDULE_TIMERS, t_schedule / 1000, t_schedule % 1000); - printf("Removing %d random timers took %ld.%03ld seconds.\n", + printf("Removing %d random timers took %lu.%03lu seconds.\n", REMOVE_TIMERS, t_remove / 1000, t_remove % 1000); fflush(stdout); |
