From 70b1266a40ba6c3d376c6a362b12c369d9f8eb97 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 7 Nov 2016 21:27:58 +0100 Subject: selftest: add routing table tests for small subnets --- src/selftest/routing-table.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/selftest/routing-table.h b/src/selftest/routing-table.h index 6db7958..fe7a0bc 100644 --- a/src/selftest/routing-table.h +++ b/src/selftest/routing-table.h @@ -57,6 +57,12 @@ bool routing_table_selftest(void) insert(6, a, 0x24046800, 0x40040800, 0xdeadbeef, 0xdeadbeef, 128); insert(4, g, 64, 15, 112, 0, 20); insert(4, h, 64, 15, 123, 211, 25); /* maskself is required */ + insert(4, a, 10, 0, 0, 0, 25); + insert(4, b, 10, 0, 0, 128, 25); + insert(4, a, 10, 1, 0, 0, 30); + insert(4, b, 10, 1, 0, 4, 30); + insert(4, c, 10, 1, 0, 8, 29); + insert(4, d, 10, 1, 0, 16, 29); #undef insert success = true; @@ -90,6 +96,12 @@ bool routing_table_selftest(void) test(4, g, 64, 15, 123, 1); test(4, h, 64, 15, 123, 128); test(4, h, 64, 15, 123, 129); + test(4, a, 10, 0, 0, 52); + test(4, b, 10, 0, 0, 220); + test(4, a, 10, 1, 0, 2); + test(4, b, 10, 1, 0, 6); + test(4, c, 10, 1, 0, 10); + test(4, d, 10, 1, 0, 20); #undef test /* These will hit the BUG_ON(len >= 128) in free_node if something goes wrong. */ -- cgit v1.2.3-59-g8ed1b