diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-11-07 21:27:58 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-11-07 21:27:58 +0100 |
commit | aee74552baf256d5531519a861a8ddfd9e2cd44a (patch) | |
tree | 7c1c6f13b736ef2e3136b265e1141dd898875003 /src/selftest/routing-table.h | |
parent | a1d244771e7528b9a1766e36d18950360983b8d9 (diff) |
selftest: add routing table tests for small subnets
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/selftest/routing-table.h')
-rw-r--r-- | src/selftest/routing-table.h | 12 |
1 files changed, 12 insertions, 0 deletions
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. */ |