From e3c5f7b6890a5c78f1ab3355e2215583d965658c Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 13 Jul 2018 06:14:53 -0400 Subject: [PATCH 1/3] tests: Fix const change Some of the parameters for lib/srcdest.. have changed to consts, make the test cases respect that. Signed-off-by: Donald Sharp --- tests/lib/test_srcdest_table.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/lib/test_srcdest_table.c b/tests/lib/test_srcdest_table.c index 53180564bd..e717da15b3 100644 --- a/tests/lib/test_srcdest_table.c +++ b/tests/lib/test_srcdest_table.c @@ -392,7 +392,8 @@ static void test_state_del_one_route(struct test_state *test, struct prng *prng) } assert(rn); - srcdest_rnode_prefixes(rn, &dst_p, &src_p); + srcdest_rnode_prefixes(rn, (const struct prefix **)&dst_p, + (const struct prefix **)&src_p); memcpy(&dst6_p, dst_p, sizeof(dst6_p)); if (src_p) memcpy(&src6_p, src_p, sizeof(src6_p)); From 9fc8a332b10b7ef14ffbadb167dcffdafcc8174f Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 13 Jul 2018 07:26:32 -0400 Subject: [PATCH 2/3] tests: Prevent weird type promotion objection in bgp tests The va_start function cannot take a object that can be type promoted Looks like a new warning coming in from a new compiler. Signed-off-by: Donald Sharp --- tests/bgpd/test_bgp_table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/bgpd/test_bgp_table.c b/tests/bgpd/test_bgp_table.c index 01ce7480d7..a0382827b9 100644 --- a/tests/bgpd/test_bgp_table.c +++ b/tests/bgpd/test_bgp_table.c @@ -116,8 +116,8 @@ static void check_lookup_result(struct list *list, va_list arglist) assert(prefix_count == listcount(list)); } -static void do_test(struct bgp_table *table, const char *prefix, uint8_t maxlen, - ...) +static void do_test(struct bgp_table *table, const char *prefix, + uint32_t maxlen, ...) { va_list arglist; struct list *list = list_new(); From ccc34deb3830addd15ea8fa0e41e5444bca47815 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 25 Jul 2018 15:00:52 -0400 Subject: [PATCH 3/3] tests: Let compiler know this was an intentionall fallthrough Let the compiler know that this code intentionally fell through to the next case statement in a switch. Signed-off-by: Donald Sharp --- tests/bgpd/test_capability.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/bgpd/test_capability.c b/tests/bgpd/test_capability.c index c75a699a16..4612bdc26b 100644 --- a/tests/bgpd/test_capability.c +++ b/tests/bgpd/test_capability.c @@ -821,6 +821,7 @@ static void parse_test(struct peer *peer, struct test_segment *t, int type) switch (type) { case CAPABILITY: len += 2; /* to cover the OPT-Param header */ + __attribute__ ((fallthrough)); case OPT_PARAM: printf("len: %u\n", len); /* peek_for_as4 wants getp at capibility*/