1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

unittest/fib: fix printf formating for OS X

This commit is contained in:
Thomas Eichinger 2015-09-03 16:58:06 +02:00
parent 9da61ab85a
commit 99720b4eec

View File

@ -37,7 +37,7 @@ static void _fill_FIB_unique(size_t entries)
for (size_t i = 0; i < entries; ++i) {
/* construct "addresses" for the FIB */
snprintf(addr_dst, add_buf_size, "Test address %02d", (int)i);
snprintf(addr_nxt, add_buf_size, "Test address %02d", entries + i);
snprintf(addr_nxt, add_buf_size, "Test address %02d", (int)(entries + i));
/* the terminating \0 is unnecessary here */
fib_add_entry(&test_fib_table, 42,
(uint8_t *)addr_dst, add_buf_size - 1, addr_dst_flags,
@ -61,7 +61,7 @@ static void _fill_FIB_multiple(size_t entries, size_t modulus)
for (size_t i = 0; i < entries; ++i) {
/* construct "addresses" for the FIB */
snprintf(addr_dst, add_buf_size, "Test address %02d", (int)i);
snprintf(addr_nxt, add_buf_size, "Test address %02d", i % modulus);
snprintf(addr_nxt, add_buf_size, "Test address %02d", (int)(i % modulus));
fib_add_entry(&test_fib_table, 42,
(uint8_t *)addr_dst, add_buf_size - 1, addr_dst_flags,
(uint8_t *)addr_nxt, add_buf_size - 1, addr_nxt_flags,
@ -190,7 +190,7 @@ static void test_fib_05_remove_upper_half(void)
for (size_t i = 0; i < entries / 2; ++i) {
/* construct "addresses" to remove */
snprintf(addr_dst, add_buf_size, "Test address %02d", ((entries / 2) + i));
snprintf(addr_dst, add_buf_size, "Test address %02d", (int)((entries / 2) + i));
fib_remove_entry(&test_fib_table, (uint8_t *)addr_dst, add_buf_size - 1);
}
@ -673,7 +673,7 @@ static void test_fib_17_get_entry_set(void)
for (size_t i = 0; i < 20; ++i) {
/* construct "addresses" for the FIB */
snprintf(addr_dst, addr_buf_size, "Test address %02d", (int)i);
snprintf(addr_nxt, addr_buf_size, "Test address %02d", i % 11);
snprintf(addr_nxt, addr_buf_size, "Test address %02d", (int)(i % 11));
fib_add_entry(&test_fib_table, 42,
(uint8_t *)addr_dst, addr_buf_size - 1, 0x0,
(uint8_t *)addr_nxt, addr_buf_size - 1, 0x0, 100000);