File tree 1 file changed +15
-0
lines changed
tests/drivers/can/canfd/src
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -339,6 +339,20 @@ static void send_receive(const struct zcan_filter *filter1,
339
339
can_remove_rx_filter (can_dev , filter_id_2 );
340
340
}
341
341
342
+ /**
343
+ * @brief Test getting the CAN controller capabilities.
344
+ */
345
+ static void test_get_capabilities (void )
346
+ {
347
+ can_mode_t cap ;
348
+ int err ;
349
+
350
+ err = can_get_capabilities (can_dev , & cap );
351
+ zassert_equal (err , 0 , "failed to get CAN capabilities (err %d)" , err );
352
+ zassert_not_equal (cap & (CAN_MODE_LOOPBACK | CAN_MODE_FD ), 0 ,
353
+ "CAN-FD loopback mode not supported" );
354
+ }
355
+
342
356
/**
343
357
* @brief Test configuring the CAN controller for loopback mode.
344
358
*
@@ -388,6 +402,7 @@ void test_main(void)
388
402
zassert_true (device_is_ready (can_dev ), "CAN device not ready" );
389
403
390
404
ztest_test_suite (canfd_driver ,
405
+ ztest_unit_test (test_get_capabilities ),
391
406
ztest_unit_test (test_set_loopback ),
392
407
ztest_unit_test (test_send_receive_classic ),
393
408
ztest_unit_test (test_send_receive_fd ),
You can’t perform that action at this time.
0 commit comments