tests: drivers: can: api: check frames in test_send_receive_msgq()

Test that the received frames in test_send_receive_msgq() matches the
frames sent.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
Henrik Brix Andersen 2022-04-08 09:25:18 +02:00 committed by Carles Cufí
commit 3e290c636e

View file

@ -779,6 +779,7 @@ void test_send_receive_msgq(void)
for (i = 0; i < nframes; i++) { for (i = 0; i < nframes; i++) {
err = k_msgq_get(&can_msgq, &frame, TEST_RECEIVE_TIMEOUT); err = k_msgq_get(&can_msgq, &frame, TEST_RECEIVE_TIMEOUT);
zassert_equal(err, 0, "receive timeout"); zassert_equal(err, 0, "receive timeout");
assert_frame_equal(&frame, &test_std_frame_1, 0);
} }
for (i = 0; i < nframes; i++) { for (i = 0; i < nframes; i++) {
@ -788,6 +789,7 @@ void test_send_receive_msgq(void)
for (i = 0; i < nframes; i++) { for (i = 0; i < nframes; i++) {
err = k_msgq_get(&can_msgq, &frame, TEST_RECEIVE_TIMEOUT); err = k_msgq_get(&can_msgq, &frame, TEST_RECEIVE_TIMEOUT);
zassert_equal(err, 0, "receive timeout"); zassert_equal(err, 0, "receive timeout");
assert_frame_equal(&frame, &test_std_frame_1, 0);
} }
can_remove_rx_filter(can_dev, filter_id); can_remove_rx_filter(can_dev, filter_id);