summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2018-07-12 15:51:52 +0200
committerMark Stapp <mjs@voltanet.io>2018-07-12 15:51:52 +0200
commit2861a0deda0452bdda01bfef34f9897b796217e5 (patch)
treee2ce5626e61b379bfb970c134b8501a6228e6a21 /tests/lib
parentMerge pull request #2655 from mjstapp/lib_const_prefix (diff)
downloadfrr-2861a0deda0452bdda01bfef34f9897b796217e5.tar.xz
frr-2861a0deda0452bdda01bfef34f9897b796217e5.zip
tests: align with srcdest lib changes, remove bgp binary
Align the srcdest table test with recent api changes that use 'const' more strictly. Remove test_bgp_table binary - looks as if it was committed by mistake. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/test_srcdest_table.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/lib/test_srcdest_table.c b/tests/lib/test_srcdest_table.c
index 04e85435d..53180564b 100644
--- a/tests/lib/test_srcdest_table.c
+++ b/tests/lib/test_srcdest_table.c
@@ -228,7 +228,8 @@ static void test_dump(struct test_state *test)
}
static void test_failed(struct test_state *test, const char *message,
- struct prefix_ipv6 *dst_p, struct prefix_ipv6 *src_p)
+ const struct prefix_ipv6 *dst_p,
+ const struct prefix_ipv6 *src_p)
{
char *route_id = format_srcdest(dst_p, src_p);
@@ -250,7 +251,7 @@ static void test_state_verify(struct test_state *test)
/* Verify that there are no elements in the table which have never
* been added */
for (rn = route_top(test->table); rn; rn = srcdest_route_next(rn)) {
- struct prefix_ipv6 *dst_p, *src_p;
+ const struct prefix_ipv6 *dst_p, *src_p;
/* While we are iterating, we hold a lock on the current
* route_node,
@@ -288,10 +289,10 @@ static void test_state_verify(struct test_state *test)
expected_lock++;
if (rn->lock != expected_lock) {
- struct prefix_ipv6 *dst_p, *src_p;
+ const struct prefix_ipv6 *dst_p, *src_p;
srcdest_rnode_prefixes(
- rn, (struct prefix **)&dst_p,
- (struct prefix **)&src_p);
+ rn, (const struct prefix **)&dst_p,
+ (const struct prefix **)&src_p);
test_failed(
test,
@@ -305,8 +306,8 @@ static void test_state_verify(struct test_state *test)
assert(rn->info == (void *)0xdeadbeef);
- srcdest_rnode_prefixes(rn, (struct prefix **)&dst_p,
- (struct prefix **)&src_p);
+ srcdest_rnode_prefixes(rn, (const struct prefix **)&dst_p,
+ (const struct prefix **)&src_p);
memcpy(&hash_entry[0], dst_p, sizeof(*dst_p));
if (src_p)
memcpy(&hash_entry[1], src_p, sizeof(*src_p));
@@ -377,7 +378,7 @@ static void test_state_del_one_route(struct test_state *test, struct prng *prng)
which_route = prng_rand(prng) % test->log->count;
struct route_node *rn;
- struct prefix *dst_p, *src_p;
+ const struct prefix *dst_p, *src_p;
struct prefix_ipv6 dst6_p, src6_p;
for (rn = route_top(test->table); rn; rn = srcdest_route_next(rn)) {