Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test/unittest: cleanup most vera++ complains #18807

Merged
merged 1 commit into from
Oct 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,020 changes: 1,010 additions & 1,010 deletions tests/unittests/tests-bloom/tests-bloom-sets.h

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions tests/unittests/tests-clif/tests-clif.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static void test_clif_encode_links(void)
}
pos += res;

res = clif_encode_link(&links[i],NULL, 0);
res = clif_encode_link(&links[i], NULL, 0);
if (res <= 0) {
break;
}
Expand Down Expand Up @@ -157,7 +157,8 @@ static void test_clif_decode_links(void)
"</sensors/light>;rt=\"light-lux\";if=sensor,"
"<http://www.example.com/sensors/t123>;"
"anchor=\"/sensors/temp\";rel=\"describedby\";sz=1234,"
"</t>;anchor=\"/sensors/temp\";rel=\"alternate\";a;s=\"This is \\\"escaped and has , \\\"\","
"</t>;anchor=\"/sensors/temp\";rel=\"alternate\";a;s=\""
"This is \\\"escaped and has , \\\"\","
"</riot/board>,</riot/info>;obs";

/* ordered expected types to be decoded */
Expand Down
3 changes: 2 additions & 1 deletion tests/unittests/tests-core/tests-core-bitarithm.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ static void test_bitarithm_bits_set_random(void)

static void test_bitarithm_bits_set_u32_random(void)
{
TEST_ASSERT_EQUAL_INT(21, bitarithm_bits_set_u32(4072524027)); /* Source: https://www.random.org/bytes */
TEST_ASSERT_EQUAL_INT(21, bitarithm_bits_set_u32(4072524027));
/* Source: https://www.random.org/bytes */
}

Test *tests_core_bitarithm_tests(void)
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/tests-core/tests-core-ringbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static void tests_core_ringbuffer_remove_underflow(void)
ringbuffer_add_one(&buf, 0);
ringbuffer_add_one(&buf, 1);

ringbuffer_remove(&buf,1);
ringbuffer_remove(&buf, 1);

TEST_ASSERT_EQUAL_INT(1, ringbuffer_get_one(&buf));
TEST_ASSERT_EQUAL_INT(1, ringbuffer_empty(&buf));
Expand Down
3 changes: 2 additions & 1 deletion tests/unittests/tests-core/tests-core-xfa-data1.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ XFA_INIT_CONST(xfatest_t, xfatest_use_const);

XFA(xfatest_use, 0) xfatest_t _xfatest_use1 = { .val = 3333, .text = "xfatest_use1" };
XFA(xfatest_use, 0) xfatest_t _xfatest_use_again = { .val = 555, .text = "xfatest use again" };
XFA_CONST(xfatest_use_const, 0) xfatest_t _xfatest_use_const1 = { .val = 4444, .text = "xfatest_use_const1" };
XFA_CONST(xfatest_use_const, 0) xfatest_t _xfatest_use_const1 =
{ .val = 4444, .text = "xfatest_use_const1" };

int hack1;
/** @} */
6 changes: 4 additions & 2 deletions tests/unittests/tests-core/tests-core-xfa-data2.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
#include "tests-core-xfa.h"

XFA(xfatest, 0) xfatest_t _xfatest2 = { .val = 0xbeef, .text = "another test string" };
XFA_CONST(xfatest_const, 0) xfatest_t _xfatest_const2 = { .val = 32444, .text = "const string xfa 2" };
XFA_CONST(xfatest_const, 0) xfatest_t _xfatest_const2 =
{ .val = 32444, .text = "const string xfa 2" };
XFA(xfatest_use, 0) xfatest_t _xfatest_use2 = { .val = 11111, .text = "xfatest_use2" };
XFA_CONST(xfatest_use_const, 0) xfatest_t _xfatest_use_const2 = { .val = 22222, .text = "xfatest_use_const2" };
XFA_CONST(xfatest_use_const, 0) xfatest_t _xfatest_use_const2 =
{ .val = 22222, .text = "xfatest_use_const2" };

/** @} */
26 changes: 13 additions & 13 deletions tests/unittests/tests-fib/tests-fib.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ static void test_fib_06_remove_one_entry(void)
TEST_ASSERT_EQUAL_INT(20, fib_get_num_used_entries(&test_fib_table));
TEST_ASSERT_EQUAL_INT(20, universal_address_get_num_used_entries());

fib_remove_entry(&test_fib_table, (uint8_t *)addr_dst,add_buf_size - 1);
fib_remove_entry(&test_fib_table, (uint8_t *)addr_dst, add_buf_size - 1);

#if (TEST_FIB_SHOW_OUTPUT == 1)
fib_print_fib_table(&test_fib_table);
Expand Down Expand Up @@ -725,7 +725,7 @@ static void test_fib_17_get_entry_set(void)
size_t arr_size = 20;
fib_destination_set_entry_t arr_dst[arr_size];
char prefix[addr_buf_size];
memset(prefix,0, addr_buf_size);
memset(prefix, 0, addr_buf_size);
/* cppcheck-suppress redundantCopy
* (reason: prefix is set to all 0 before adding an address) */
snprintf(prefix, addr_buf_size, "Test address 1");
Expand All @@ -739,7 +739,7 @@ static void test_fib_17_get_entry_set(void)
TEST_ASSERT_EQUAL_INT(10, arr_size);
arr_size = 20;

memset(prefix,0, addr_buf_size);
memset(prefix, 0, addr_buf_size);
/* cppcheck-suppress redundantCopy
* (reason: prefix is set to all 0 before adding an address) */
snprintf(prefix, addr_buf_size, "Test address 0");
Expand Down Expand Up @@ -768,8 +768,8 @@ static void test_fib_17_get_entry_set(void)

#if (TEST_FIB_SHOW_OUTPUT == 1)
puts("");
for(size_t i = 0; i < arr_size; ++i) {
for( size_t j = 0; j < arr_dst[i].dest_size; ++j) {
for (size_t i = 0; i < arr_size; ++i) {
for (size_t j = 0; j < arr_dst[i].dest_size; ++j) {
printf("%c", (char)arr_dst[i].dest[j]);
}
puts("");
Expand All @@ -796,7 +796,7 @@ static void test_fib_18_get_next_hop_invalid_parameters(void)
_fill_FIB_multiple(entries, 11);

int ret = fib_get_next_hop(&test_fib_table, NULL, NULL,
NULL, NULL,NULL, add_buf_size - 1, 0x13);
NULL, NULL, NULL, add_buf_size - 1, 0x13);

TEST_ASSERT_EQUAL_INT(-EINVAL, ret);

Expand Down Expand Up @@ -839,7 +839,7 @@ static void test_fib_19_default_gateway(void)
snprintf(addr_lookup, add_buf_size, "Some address X1");

/* set the bytes to 0x01..0x10 of the next-hop */
for(size_t i = 0; i < add_buf_size; i++) {
for (size_t i = 0; i < add_buf_size; i++) {
addr_nxt[i] = i+1;
}

Expand All @@ -861,7 +861,7 @@ static void test_fib_19_default_gateway(void)
memset(addr_nxt_hop, 0, add_buf_size);

/* set the bytes to 0x02..0x11 of the new next-hop for the default gateway */
for(size_t i = 0; i < add_buf_size; ++i) {
for (size_t i = 0; i < add_buf_size; ++i) {
addr_nxt[i] = i+2;
}

Expand Down Expand Up @@ -906,17 +906,17 @@ static void test_fib_20_replace_prefix(void)
memset(addr_lookup, 0, add_buf_size);

/* set the bytes to 0x01..0x10 of the next-hop */
for(size_t i = 0; i < add_buf_size; i++) {
for (size_t i = 0; i < add_buf_size; i++) {
addr_nxt[i] = i+1;
}

/* set the bytes to 0x01..0x08 of the destination prefix */
for(size_t i = 0; i < add_buf_size/2; i++) {
for (size_t i = 0; i < add_buf_size/2; i++) {
addr_dst[i] = i+1;
}

/* set the bytes to 0x01..0x0e of the lookup address */
for(size_t i = 0; i < 14; i++) {
for (size_t i = 0; i < 14; i++) {
addr_lookup[i] = i+1;
}

Expand All @@ -942,12 +942,12 @@ static void test_fib_20_replace_prefix(void)
memset(addr_nxt_hop, 0, add_buf_size);

/* set the bytes to 0x02..0x11 of the new next-hop */
for(size_t i = 0; i < add_buf_size; ++i) {
for (size_t i = 0; i < add_buf_size; ++i) {
addr_nxt[i] = i+2;
}

/* set the bytes to 0x01..0x0d of the new destination prefix */
for(size_t i = 0; i < 13; i++) {
for (size_t i = 0; i < 13; i++) {
addr_dst[i] = i+1;
}

Expand Down
3 changes: 2 additions & 1 deletion tests/unittests/tests-frac/tests-frac.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ static void test_frac_scale32(void)
if ((uint32_t)expected != actual) {
int32_t diff = actual - expected;
DEBUG("%" PRIu32 " * (%" PRIu32 " / %" PRIu32 ")"
" tmp %" PRIu64 " expect %" PRIu32 ", actual %" PRIu32 ", diff = %" PRId32 " shift=%u\n",
" tmp %" PRIu64 " expect %" PRIu32 ", actual %" PRIu32
", diff = %" PRId32 " shift=%u\n",
u32_test_values[i], num, den, tmp, (uint32_t)expected,
actual, diff, frac.shift);

Expand Down
3 changes: 2 additions & 1 deletion tests/unittests/tests-gcoap/tests-gcoap.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ static gcoap_listener_t listener_second = {
.next = NULL
};

static const char *resource_list_str = "</second/part>,</act/switch>,</sensor/temp>,</test/info/all>";
static const char *resource_list_str =
"</second/part>,</act/switch>,</sensor/temp>,</test/info/all>";

/*
* Client GET request success case. Test request generation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ static void test_nib_ft_del__unknown(void)
iface++;
}
gnrc_ipv6_nib_ft_del(&dst, dst_len);
while(gnrc_ipv6_nib_ft_iter(NULL, 0, &iter_state, &fte)) {
while (gnrc_ipv6_nib_ft_iter(NULL, 0, &iter_state, &fte)) {
count++;
}
TEST_ASSERT_EQUAL_INT(MAX_NUMOF, count);
Expand All @@ -636,7 +636,7 @@ static void test_nib_ft_del__success(void)
TEST_ASSERT_EQUAL_INT(0, gnrc_ipv6_nib_ft_add(&dst, GLOBAL_PREFIX_LEN,
&next_hop, IFACE, 0));
gnrc_ipv6_nib_ft_del(&dst, GLOBAL_PREFIX_LEN);
TEST_ASSERT(!gnrc_ipv6_nib_ft_iter(NULL ,0, &iter_state, &fte));
TEST_ASSERT(!gnrc_ipv6_nib_ft_iter(NULL, 0, &iter_state, &fte));
}

/**
Expand Down
22 changes: 11 additions & 11 deletions tests/unittests/tests-gnrc_mac_internal/tests-gnrc_mac_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ static void test_gnrc_mac_queue_tx_packet(void)
#if CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0

gnrc_pktsnip_t *pkt_head;
TEST_ASSERT(gnrc_mac_queue_tx_packet(&tx,1,pkt1));
TEST_ASSERT(gnrc_mac_queue_tx_packet(&tx, 1, pkt1));
pkt_head = gnrc_priority_pktqueue_head(&tx.neighbors[1].queue);
TEST_ASSERT(pkt_head == pkt1);
TEST_ASSERT(1 == gnrc_priority_pktqueue_length(&tx.neighbors[1].queue));
TEST_ASSERT_EQUAL_STRING(TEST_STRING4, pkt_head->next->data);

TEST_ASSERT(gnrc_mac_queue_tx_packet(&tx,0,pkt2));
TEST_ASSERT(gnrc_mac_queue_tx_packet(&tx, 0, pkt2));
pkt_head = gnrc_priority_pktqueue_head(&tx.neighbors[1].queue);
TEST_ASSERT(pkt_head == pkt2);
TEST_ASSERT(2 == gnrc_priority_pktqueue_length(&tx.neighbors[1].queue));
Expand All @@ -114,40 +114,40 @@ static void test_gnrc_mac_queue_tx_packet(void)
TEST_ASSERT(pkt_head == pkt1);
TEST_ASSERT_EQUAL_STRING(TEST_STRING4, pkt_head->next->data);

TEST_ASSERT(gnrc_mac_queue_tx_packet(&tx,0,pkt3));
TEST_ASSERT(gnrc_mac_queue_tx_packet(&tx, 0, pkt3));
pkt_head = gnrc_priority_pktqueue_head(&tx.neighbors[2].queue);
TEST_ASSERT(pkt_head == pkt3);
TEST_ASSERT(1 == gnrc_priority_pktqueue_length(&tx.neighbors[2].queue));
TEST_ASSERT_EQUAL_STRING(TEST_STRING16, pkt_head->next->data);

TEST_ASSERT(gnrc_mac_queue_tx_packet(&tx,0,pkt_bcast));
TEST_ASSERT(gnrc_mac_queue_tx_packet(&tx, 0, pkt_bcast));
pkt_head = gnrc_priority_pktqueue_head(&tx.neighbors[0].queue);
TEST_ASSERT(pkt_head == pkt_bcast);
TEST_ASSERT(1 == gnrc_priority_pktqueue_length(&tx.neighbors[0].queue));
TEST_ASSERT_EQUAL_STRING(TEST_STRING12, pkt_head->next->data);

#else

TEST_ASSERT(gnrc_mac_queue_tx_packet(&tx,1,pkt1));
TEST_ASSERT(gnrc_mac_queue_tx_packet(&tx, 1, pkt1));
TEST_ASSERT(1 == gnrc_priority_pktqueue_length(&tx.queue));
gnrc_pktsnip_t *pkt_head;
pkt_head = gnrc_priority_pktqueue_head(&tx.queue);
TEST_ASSERT(pkt_head == pkt1);
TEST_ASSERT_EQUAL_STRING(TEST_STRING4, pkt_head->next->data);

TEST_ASSERT(gnrc_mac_queue_tx_packet(&tx,1,pkt2));
TEST_ASSERT(gnrc_mac_queue_tx_packet(&tx, 1, pkt2));
TEST_ASSERT(2 == gnrc_priority_pktqueue_length(&tx.queue));
pkt_head = gnrc_priority_pktqueue_head(&tx.queue);
TEST_ASSERT(pkt_head == pkt1);
TEST_ASSERT_EQUAL_STRING(TEST_STRING4, pkt_head->next->data);

TEST_ASSERT(gnrc_mac_queue_tx_packet(&tx,0,pkt3));
TEST_ASSERT(gnrc_mac_queue_tx_packet(&tx, 0, pkt3));
TEST_ASSERT(3 == gnrc_priority_pktqueue_length(&tx.queue));
pkt_head = gnrc_priority_pktqueue_head(&tx.queue);
TEST_ASSERT(pkt_head == pkt3);
TEST_ASSERT_EQUAL_STRING(TEST_STRING16, pkt_head->next->data);

TEST_ASSERT(gnrc_mac_queue_tx_packet(&tx,0,pkt_bcast));
TEST_ASSERT(gnrc_mac_queue_tx_packet(&tx, 0, pkt_bcast));
TEST_ASSERT(4 == gnrc_priority_pktqueue_length(&tx.queue));
pkt_head = gnrc_priority_pktqueue_head(&tx.queue);
TEST_ASSERT(pkt_head == pkt3);
Expand Down Expand Up @@ -198,7 +198,7 @@ static void test_gnrc_mac_queue_rx_packet(void)
gnrc_pktsnip_t *pkt3 = gnrc_pktbuf_add(NULL, TEST_STRING16, sizeof(TEST_STRING16),
GNRC_NETTYPE_UNDEF);

TEST_ASSERT(gnrc_mac_queue_rx_packet(&rx,1,pkt1));
TEST_ASSERT(gnrc_mac_queue_rx_packet(&rx, 1, pkt1));
TEST_ASSERT(1 == gnrc_priority_pktqueue_length(&rx.queue));

gnrc_pktsnip_t *pkt_head;
Expand All @@ -207,15 +207,15 @@ static void test_gnrc_mac_queue_rx_packet(void)
TEST_ASSERT(pkt_head == pkt1);
TEST_ASSERT_EQUAL_STRING(TEST_STRING4, pkt_head->data);

TEST_ASSERT(gnrc_mac_queue_rx_packet(&rx,1,pkt2));
TEST_ASSERT(gnrc_mac_queue_rx_packet(&rx, 1, pkt2));
TEST_ASSERT(2 == gnrc_priority_pktqueue_length(&rx.queue));

pkt_head = gnrc_priority_pktqueue_head(&rx.queue);

TEST_ASSERT(pkt_head == pkt1);
TEST_ASSERT_EQUAL_STRING(TEST_STRING4, pkt_head->data);

TEST_ASSERT(gnrc_mac_queue_rx_packet(&rx,0,pkt3));
TEST_ASSERT(gnrc_mac_queue_rx_packet(&rx, 0, pkt3));
TEST_ASSERT(3 == gnrc_priority_pktqueue_length(&rx.queue));

pkt_head = gnrc_priority_pktqueue_head(&rx.queue);
Expand Down
25 changes: 16 additions & 9 deletions tests/unittests/tests-hashes/tests-hashes-sha1.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,20 @@ static const char *_resultarray[TEST_CASES_NUM + 2] =

#define TEST_CASES_HMAC_NUM (5)

#define TEST1_HMAC "Hi There"
#define TEST2_HMAC "what do ya want for nothing?"
#define TEST1_HMAC "Hi There"
#define TEST2_HMAC "what do ya want for nothing?"
#define TEST3_HMAC "Test With Truncation"
#define TEST4_HMAC "Test Using Larger Than Block-Size Key - Hash Key First"
#define TEST5_HMAC "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data"

static const uint8_t _hmac_key1[]={
0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b
0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b
};
static const uint8_t _hmac_key2[]= "Jefe";
static const uint8_t _hmac_key3[]={
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c
};
static const uint8_t _hmac_key4[]={
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
Expand Down Expand Up @@ -181,11 +183,16 @@ static void test_hashes_sha1(void)
TEST_ASSERT(calc_and_compare_hash2(_testarray[2], _resultarray[4]) == 0);
TEST_ASSERT(calc_and_compare_hash2(_testarray[3], _resultarray[5]) == 0);

TEST_ASSERT(calc_and_compare_hash_hmac(TEST1_HMAC, _resultarray_hmac[0], _hmac_key1, sizeof(_hmac_key1)) == 0);
TEST_ASSERT(calc_and_compare_hash_hmac(TEST2_HMAC, _resultarray_hmac[1], _hmac_key2, sizeof(_hmac_key2)) == 0);
TEST_ASSERT(calc_and_compare_hash_hmac(TEST3_HMAC, _resultarray_hmac[2], _hmac_key3, sizeof(_hmac_key3)) == 0);
TEST_ASSERT(calc_and_compare_hash_hmac(TEST4_HMAC, _resultarray_hmac[3], _hmac_key4, sizeof(_hmac_key4)) == 0);
TEST_ASSERT(calc_and_compare_hash_hmac(TEST5_HMAC, _resultarray_hmac[4], _hmac_key5, sizeof(_hmac_key5)) == 0);
TEST_ASSERT(calc_and_compare_hash_hmac(TEST1_HMAC, _resultarray_hmac[0],
_hmac_key1, sizeof(_hmac_key1)) == 0);
TEST_ASSERT(calc_and_compare_hash_hmac(TEST2_HMAC, _resultarray_hmac[1],
_hmac_key2, sizeof(_hmac_key2)) == 0);
TEST_ASSERT(calc_and_compare_hash_hmac(TEST3_HMAC, _resultarray_hmac[2],
_hmac_key3, sizeof(_hmac_key3)) == 0);
TEST_ASSERT(calc_and_compare_hash_hmac(TEST4_HMAC, _resultarray_hmac[3],
_hmac_key4, sizeof(_hmac_key4)) == 0);
TEST_ASSERT(calc_and_compare_hash_hmac(TEST5_HMAC, _resultarray_hmac[4],
_hmac_key5, sizeof(_hmac_key5)) == 0);
}

Test *tests_hashes_sha1_tests(void)
Expand Down
25 changes: 16 additions & 9 deletions tests/unittests/tests-hashes/tests-hashes-sha256-hmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,11 @@ static void test_hashes_hmac_sha256_hash_PRF5(void)
static void test_hashes_hmac_sha256_hash_PRF6(void)
{
/* Test Case PRF-6: */
static const unsigned char strPRF6[] = "This is a test using a larger than block-size key and a "
"larger than block-size data. The key needs to be hashed "
"before being used by the HMAC algorithm.";
static const unsigned char strPRF6[] =
"This is a test using a larger than block-size key and a "
"larger than block-size data. The key needs to be hashed "
"before being used by the HMAC algorithm.";

unsigned char longKey[131];
static unsigned char hmac[SHA256_DIGEST_LENGTH];
memset(longKey, 0xaa, sizeof(longKey));
Expand Down Expand Up @@ -287,9 +289,11 @@ static void test_hashes_hmac_sha256_ite_hash_PRF6(void)
{
/* Test Case PRF-6: */
hmac_context_t ctx;
static const unsigned char strPRF6[] = "This is a test using a larger than block-size key and a "
"larger than block-size data. The key needs to be hashed "
"before being used by the HMAC algorithm.";
static const unsigned char strPRF6[] =
"This is a test using a larger than block-size key and a "
"larger than block-size data. The key needs to be hashed "
"before being used by the HMAC algorithm.";

unsigned char longKey[131];
static unsigned char hmac[SHA256_DIGEST_LENGTH];
memset(longKey, 0xaa, sizeof(longKey));
Expand All @@ -308,9 +312,12 @@ static void test_hashes_hmac_sha256_ite_hash_PRF6_split(void)
{
/* Test Case PRF-6: */
hmac_context_t ctx;
static const unsigned char strPRF6_1[] = "This is a test using a larger than block-size key and a ";
static const unsigned char strPRF6_2[] = "larger than block-size data. The key needs to be hashed ";
static const unsigned char strPRF6_3[] = "before being used by the HMAC algorithm.";
static const unsigned char strPRF6_1[] =
"This is a test using a larger than block-size key and a ";
static const unsigned char strPRF6_2[] =
"larger than block-size data. The key needs to be hashed ";
static const unsigned char strPRF6_3[] =
"before being used by the HMAC algorithm.";

unsigned char longKey[131];
static unsigned char hmac[SHA256_DIGEST_LENGTH];
Expand Down
3 changes: 2 additions & 1 deletion tests/unittests/tests-hashes/tests-hashes-sha256.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ static void test_hashes_sha256_hash_sequence_04(void)

static void test_hashes_sha256_hash_sequence_digits_letters(void)
{
static const char *teststring = "0123456789abcde-0123456789abcde-0123456789abcde-0123456789abcde-";
static const char *teststring =
"0123456789abcde-0123456789abcde-0123456789abcde-0123456789abcde-";
TEST_ASSERT(calc_and_compare_hash(teststring, hdigits_letters));
TEST_ASSERT(calc_and_compare_hash_wrapper(teststring, hdigits_letters));
}
Expand Down
Loading