diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-06-25 01:28:18 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-06-25 16:48:39 +0200 |
commit | c0566bb9e9c84a858ef61dd3f3034a32acf06ac9 (patch) | |
tree | 217ad4ae9e7c4be79028c55af1d1310df3bb7485 /src/routing-table.c | |
parent | e20c4c14e65e62d21b1ffb78d4a50ae8be7db348 (diff) |
tests: make fatal
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/routing-table.c')
-rw-r--r-- | src/routing-table.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/routing-table.c b/src/routing-table.c index ec98f1d..baa924a 100644 --- a/src/routing-table.c +++ b/src/routing-table.c @@ -537,12 +537,12 @@ static inline struct in6_addr *ip6(uint32_t a, uint32_t b, uint32_t c, uint32_t return &ip; } -void routing_table_selftest(void) +bool routing_table_selftest(void) { struct routing_table t; struct wireguard_peer *a = NULL, *b = NULL, *c = NULL, *d = NULL, *e = NULL, *f = NULL, *g = NULL, *h = NULL; size_t i = 0; - bool success = true; + bool success = false; struct in6_addr ip; __be64 part; @@ -576,6 +576,7 @@ void routing_table_selftest(void) insert(4, h, 64, 15, 123, 211, 25); /* maskself is required */ #undef insert + success = true; #define test(version, mem, ipa, ipb, ipc, ipd) do { \ bool _s = routing_table_lookup_v##version(&t, ip##version(ipa, ipb, ipc, ipd)) == mem; \ ++i; \ @@ -629,5 +630,7 @@ free: kfree(f); kfree(g); kfree(h); + + return success; } #endif |