From b214f84538ecc94145ce93473d16aafd61ac6ca2 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Fri, 23 Nov 2018 14:52:57 +0100 Subject: [PATCH] tests: Avoid warnings about unused arguments Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider --- tests/unittests/torture_bytearray.c | 28 +++++++++++++++++++++++++ tests/unittests/torture_packet_filter.c | 2 ++ 2 files changed, 30 insertions(+) diff --git a/tests/unittests/torture_bytearray.c b/tests/unittests/torture_bytearray.c index 4079bb47..5bb86247 100644 --- a/tests/unittests/torture_bytearray.c +++ b/tests/unittests/torture_bytearray.c @@ -10,6 +10,8 @@ static void torture_pull_le_u8(void **state) uint8_t data[2] = {0}; uint8_t result; + (void)state; + result = PULL_LE_U8(data, 0); assert_int_equal(result, 0); @@ -36,6 +38,8 @@ static void torture_pull_le_u16(void **state) uint8_t data[2] = {0, 0}; uint16_t result; + (void)state; + result = PULL_LE_U16(data, 0); assert_int_equal(result, 0); @@ -65,6 +69,8 @@ static void torture_pull_le_u32(void **state) uint8_t data[4] = {0, 0, 0, 0}; uint32_t result; + (void)state; + result = PULL_LE_U32(data, 0); assert_int_equal(result, 0); @@ -116,6 +122,8 @@ static void torture_push_le_u8(void **state) uint8_t data[4] = {0, 0, 0, 0}; uint8_t data2[4] = {42, 42, 42, 42}; + (void)state; + PUSH_LE_U8(data, 0, 42); PUSH_LE_U8(data, 1, 42); PUSH_LE_U8(data, 2, 42); @@ -129,6 +137,8 @@ static void torture_push_le_u16(void **state) uint8_t data2[4] = {0xa6, 0x7f, 0x2a, 0x00}; uint16_t result; + (void)state; + PUSH_LE_U16(data, 0, 32678); PUSH_LE_U16(data, 2, 42); assert_memory_equal(data, data2, sizeof(data)); @@ -146,6 +156,8 @@ static void torture_push_le_u32(void **state) uint8_t data2[8] = {0xa6, 0x7f, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00}; uint32_t result; + (void)state; + PUSH_LE_U32(data, 0, 32678); PUSH_LE_U32(data, 4, 42); assert_memory_equal(data, data2, sizeof(data)); @@ -166,6 +178,8 @@ static void torture_push_le_u64(void **state) uint8_t data[16] = {0}; uint64_t result; + (void)state; + PUSH_LE_U64(data, 0, 32678); result = PULL_LE_U64(data, 0); @@ -184,6 +198,8 @@ static void torture_pull_be_u8(void **state) uint8_t data[2] = {0}; uint8_t result; + (void)state; + result = PULL_BE_U8(data, 0); assert_int_equal(result, 0); @@ -210,6 +226,8 @@ static void torture_pull_be_u16(void **state) uint8_t data[2] = {0, 0}; uint16_t result; + (void)state; + result = PULL_BE_U16(data, 0); assert_int_equal(result, 0); @@ -239,6 +257,8 @@ static void torture_pull_be_u32(void **state) uint8_t data[4] = {0, 0, 0, 0}; uint32_t result; + (void)state; + result = PULL_BE_U32(data, 0); assert_int_equal(result, 0); @@ -290,6 +310,8 @@ static void torture_push_be_u8(void **state) uint8_t data[4] = {0, 0, 0, 0}; uint8_t data2[4] = {42, 42, 42, 42}; + (void)state; + PUSH_BE_U8(data, 0, 42); PUSH_BE_U8(data, 1, 42); PUSH_BE_U8(data, 2, 42); @@ -303,6 +325,8 @@ static void torture_push_be_u16(void **state) uint8_t data2[4] = {0x7f, 0xa6, 0x00, 0x2a}; uint16_t result; + (void)state; + PUSH_BE_U16(data, 0, 32678); PUSH_BE_U16(data, 2, 42); assert_memory_equal(data, data2, sizeof(data)); @@ -320,6 +344,8 @@ static void torture_push_be_u32(void **state) uint8_t data2[8] = {0x00, 0x00, 0x7f, 0xa6, 0x00, 0x00, 0x00, 0x2a}; uint32_t result; + (void)state; + PUSH_BE_U32(data, 0, 32678); PUSH_BE_U32(data, 4, 42); assert_memory_equal(data, data2, sizeof(data)); @@ -340,6 +366,8 @@ static void torture_push_be_u64(void **state) uint8_t data[16] = {0}; uint64_t result; + (void)state; + PUSH_BE_U64(data, 0, 32678); result = PULL_BE_U64(data, 0); diff --git a/tests/unittests/torture_packet_filter.c b/tests/unittests/torture_packet_filter.c index 72cbc4cd..871eb431 100644 --- a/tests/unittests/torture_packet_filter.c +++ b/tests/unittests/torture_packet_filter.c @@ -263,6 +263,8 @@ static void torture_packet_filter_check_unfiltered(void **state) enum ssh_packet_filter_result_e rc; int in_unfiltered; + (void)state; + session = ssh_new(); for (msg_type = 1; msg_type <= MESSAGE_COUNT; msg_type++) {