tests: canbus: isotp: implementation: remove random_data_len variable

Do not rely on hardcoded array size. Use sizeof() instead.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
Henrik Brix Andersen 2022-05-06 14:20:47 +02:00 committed by Maureen Helm
commit cc3b984df8
2 changed files with 2 additions and 4 deletions

View file

@ -244,9 +244,8 @@ static void test_send_receive_net_blocks(void)
zassert_equal(ret, 0, "Binding failed (%d)", ret);
for (i = 0; i < NUMBER_OF_REPETITIONS; i++) {
send_test_data(can_dev, random_data, random_data_len);
receive_test_data_net(&recv_ctx, random_data,
random_data_len, 0);
send_test_data(can_dev, random_data, sizeof(random_data));
receive_test_data_net(&recv_ctx, random_data, sizeof(random_data), 0);
}
isotp_unbind(&recv_ctx);

View file

@ -92,4 +92,3 @@ static const uint8_t random_data[] = {
0x96, 0x77, 0x0e, 0x88, 0xef, 0x54, 0x9c, 0x0f, 0xa0, 0xd6, 0x52, 0x93,
0x07, 0x3b, 0xa4, 0x96
};
unsigned int random_data_len = 1024;