tests/fib: Tidy up code style and fix cppcheck warning
This commit is contained in:
parent
7c48c891a0
commit
4e5fae77da
@ -709,7 +709,7 @@ static void test_fib_16_prefix_match(void)
|
|||||||
*/
|
*/
|
||||||
static void test_fib_17_get_entry_set(void)
|
static void test_fib_17_get_entry_set(void)
|
||||||
{
|
{
|
||||||
size_t addr_buf_size = 16;
|
static const size_t addr_buf_size = 16;
|
||||||
char addr_dst[addr_buf_size];
|
char addr_dst[addr_buf_size];
|
||||||
char addr_nxt[addr_buf_size];
|
char addr_nxt[addr_buf_size];
|
||||||
|
|
||||||
@ -742,8 +742,7 @@ static void test_fib_17_get_entry_set(void)
|
|||||||
arr_size = 20;
|
arr_size = 20;
|
||||||
|
|
||||||
memset(prefix,0, addr_buf_size);
|
memset(prefix,0, addr_buf_size);
|
||||||
/* cppcheck: prefix is set to all 0 before adding an address
|
/* cppcheck: prefix is set to all 0 before adding an address */
|
||||||
*/
|
|
||||||
/* cppcheck-suppress redundantCopy */
|
/* cppcheck-suppress redundantCopy */
|
||||||
snprintf(prefix, addr_buf_size, "Test address 0");
|
snprintf(prefix, addr_buf_size, "Test address 0");
|
||||||
|
|
||||||
@ -757,6 +756,8 @@ static void test_fib_17_get_entry_set(void)
|
|||||||
arr_size = 20;
|
arr_size = 20;
|
||||||
|
|
||||||
memset(prefix, 0, addr_buf_size);
|
memset(prefix, 0, addr_buf_size);
|
||||||
|
/* cppcheck: prefix is set to all 0 before adding an address */
|
||||||
|
/* cppcheck-suppress redundantCopy */
|
||||||
snprintf(prefix, addr_buf_size, "Test address");
|
snprintf(prefix, addr_buf_size, "Test address");
|
||||||
|
|
||||||
ret = fib_get_destination_set(&test_fib_table,
|
ret = fib_get_destination_set(&test_fib_table,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user