diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/bgpd/test_bgp_table.c | 4 | ||||
| -rw-r--r-- | tests/bgpd/test_capability.c | 1 | ||||
| -rw-r--r-- | tests/isisd/test_isis_vertex_queue.c | 53 | ||||
| -rw-r--r-- | tests/lib/test_srcdest_table.c | 3 |
4 files changed, 31 insertions, 30 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(); 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*/ diff --git a/tests/isisd/test_isis_vertex_queue.c b/tests/isisd/test_isis_vertex_queue.c index 0e473d7a6b..fe528203aa 100644 --- a/tests/isisd/test_isis_vertex_queue.c +++ b/tests/isisd/test_isis_vertex_queue.c @@ -16,43 +16,42 @@ static size_t vertex_count; static void setup_test_vertices(void) { - struct prefix p = { - .family = AF_UNSPEC + union isis_N nid, nip = { + .prefix.family = AF_UNSPEC }; - uint8_t node_id[7]; vertices = XMALLOC(MTYPE_TMP, sizeof(*vertices) * 16); - p.family = AF_INET; - p.prefixlen = 24; - inet_pton(AF_INET, "192.168.1.0", &p.u.prefix4); - vertices[vertex_count] = isis_vertex_new(&p, VTYPE_IPREACH_TE); + nip.prefix.family = AF_INET; + nip.prefix.prefixlen = 24; + inet_pton(AF_INET, "192.168.1.0", &nip.prefix.u.prefix4); + vertices[vertex_count] = isis_vertex_new(&nip, VTYPE_IPREACH_TE); vertices[vertex_count]->d_N = 20; vertex_count++; - p.family = AF_INET; - p.prefixlen = 24; - inet_pton(AF_INET, "192.168.2.0", &p.u.prefix4); - vertices[vertex_count] = isis_vertex_new(&p, VTYPE_IPREACH_TE); + nip.prefix.family = AF_INET; + nip.prefix.prefixlen = 24; + inet_pton(AF_INET, "192.168.2.0", &nip.prefix.u.prefix4); + vertices[vertex_count] = isis_vertex_new(&nip, VTYPE_IPREACH_TE); vertices[vertex_count]->d_N = 20; vertex_count++; - memset(node_id, 0, sizeof(node_id)); - node_id[6] = 1; - vertices[vertex_count] = isis_vertex_new(node_id, VTYPE_PSEUDO_TE_IS); + memset(nid.id, 0, sizeof(nid.id)); + nid.id[6] = 1; + vertices[vertex_count] = isis_vertex_new(&nid, VTYPE_PSEUDO_TE_IS); vertices[vertex_count]->d_N = 15; vertex_count++; - memset(node_id, 0, sizeof(node_id)); - node_id[5] = 2; - vertices[vertex_count] = isis_vertex_new(node_id, VTYPE_NONPSEUDO_TE_IS); + memset(nid.id, 0, sizeof(nid.id)); + nid.id[5] = 2; + vertices[vertex_count] = isis_vertex_new(&nid, VTYPE_NONPSEUDO_TE_IS); vertices[vertex_count]->d_N = 15; vertex_count++; - p.family = AF_INET; - p.prefixlen = 24; - inet_pton(AF_INET, "192.168.3.0", &p.u.prefix4); - vertices[vertex_count] = isis_vertex_new(&p, VTYPE_IPREACH_TE); + nip.prefix.family = AF_INET; + nip.prefix.prefixlen = 24; + inet_pton(AF_INET, "192.168.3.0", &nip.prefix.u.prefix4); + vertices[vertex_count] = isis_vertex_new(&nip, VTYPE_IPREACH_TE); vertices[vertex_count]->d_N = 20; vertex_count++; }; @@ -76,23 +75,23 @@ static void test_ordered(void) assert(isis_vertex_queue_count(&q) == vertex_count); for (size_t i = 0; i < vertex_count; i++) { - assert(isis_find_vertex(&q, vertices[i]->N.id, vertices[i]->type) == vertices[i]); + assert(isis_find_vertex(&q, &vertices[i]->N, vertices[i]->type) == vertices[i]); } assert(isis_vertex_queue_pop(&q) == vertices[2]); - assert(isis_find_vertex(&q, vertices[2]->N.id, vertices[2]->type) == NULL); + assert(isis_find_vertex(&q, &vertices[2]->N, vertices[2]->type) == NULL); assert(isis_vertex_queue_pop(&q) == vertices[3]); - assert(isis_find_vertex(&q, vertices[3]->N.id, vertices[3]->type) == NULL); + assert(isis_find_vertex(&q, &vertices[3]->N, vertices[3]->type) == NULL); assert(isis_vertex_queue_pop(&q) == vertices[0]); - assert(isis_find_vertex(&q, vertices[0]->N.id, vertices[0]->type) == NULL); + assert(isis_find_vertex(&q, &vertices[0]->N, vertices[0]->type) == NULL); assert(isis_vertex_queue_pop(&q) == vertices[1]); - assert(isis_find_vertex(&q, vertices[1]->N.id, vertices[1]->type) == NULL); + assert(isis_find_vertex(&q, &vertices[1]->N, vertices[1]->type) == NULL); isis_vertex_queue_delete(&q, vertices[4]); - assert(isis_find_vertex(&q, vertices[4]->N.id, vertices[4]->type) == NULL); + assert(isis_find_vertex(&q, &vertices[4]->N, vertices[4]->type) == NULL); assert(isis_vertex_queue_count(&q) == 0); assert(isis_vertex_queue_pop(&q) == NULL); 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)); |
