From 1dba254e107dd0c4254d58e9304fc6293b46fd4d Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Tue, 1 May 2012 16:20:33 +0100 Subject: tests: Fix some compile errors and warnings * aspath_test.c: match changes in aspath_unintern. Fix printf size_t warning. * bgp_capability_test.c: compile warnings. * bgp_mp_attr_test.c: update for attr parser context struct * ecommunity_test.c: ecommunity_free/ecommunity * test-checksum.c: some unused vars and funcs without need of prototypes. --- tests/bgp_mp_attr_test.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'tests/bgp_mp_attr_test.c') diff --git a/tests/bgp_mp_attr_test.c b/tests/bgp_mp_attr_test.c index 9cbe9f22..1a48f4b7 100644 --- a/tests/bgp_mp_attr_test.c +++ b/tests/bgp_mp_attr_test.c @@ -438,6 +438,15 @@ parse_test (struct peer *peer, struct test_segment *t, int type) int oldfailed = failed; struct attr attr; struct bgp_nlri nlri; + struct bgp_attr_parser_args attr_args = { + .peer = peer, + .length = t->len, + .total = 1, + .attr = &attr, + .type = BGP_ATTR_MP_REACH_NLRI, + .flags = BGP_ATTR_FLAG_OPTIONAL, + .startp = BGP_INPUT_PNT (peer), + }; #define RANDOM_FUZZ 35 stream_reset (peer->ibuf); @@ -447,11 +456,12 @@ parse_test (struct peer *peer, struct test_segment *t, int type) stream_write (peer->ibuf, t->data, t->len); printf ("%s: %s\n", t->name, t->desc); - + + if (type == BGP_ATTR_MP_REACH_NLRI) - ret = bgp_mp_reach_parse (peer, t->len, &attr, BGP_ATTR_FLAG_OPTIONAL, BGP_INPUT_PNT (peer), &nlri); + ret = bgp_mp_reach_parse (&attr_args, &nlri); else - ret = bgp_mp_unreach_parse (peer, t->len, BGP_ATTR_FLAG_OPTIONAL, BGP_INPUT_PNT (peer), &nlri); + ret = bgp_mp_unreach_parse (&attr_args, &nlri); if (!ret) { -- cgit v1.2.1