File tree 1 file changed +14
-0
lines changed
tests/drivers/can/api/src
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -598,6 +598,19 @@ static void test_get_core_clock(void)
598
598
zassert_not_equal (rate , 0 , "CAN core clock rate is 0" );
599
599
}
600
600
601
+ /**
602
+ * @brief Test getting the CAN controller capabilities.
603
+ */
604
+ static void test_get_capabilities (void )
605
+ {
606
+ can_mode_t cap ;
607
+ int err ;
608
+
609
+ err = can_get_capabilities (can_dev , & cap );
610
+ zassert_equal (err , 0 , "failed to get CAN capabilities (err %d)" , err );
611
+ zassert_not_equal (cap & CAN_MODE_LOOPBACK , 0 , "CAN loopback mode not supported" );
612
+ }
613
+
601
614
/**
602
615
* @brief CAN state change callback.
603
616
*/
@@ -1009,6 +1022,7 @@ void test_main(void)
1009
1022
/* Tests without callbacks can run in userspace */
1010
1023
ztest_test_suite (can_api_tests ,
1011
1024
ztest_user_unit_test (test_get_core_clock ),
1025
+ ztest_user_unit_test (test_get_capabilities ),
1012
1026
ztest_unit_test (test_set_state_change_callback ),
1013
1027
ztest_user_unit_test (test_set_bitrate_too_high ),
1014
1028
ztest_user_unit_test (test_set_bitrate ),
You can’t perform that action at this time.
0 commit comments