add class_hid_keyboard_init and test code
add define _TINY_USB_SOURCE_FILE_ to hide internal API from application
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
- MCU=MCU_LPC43XX
|
||||
- CORE_M4
|
||||
- __CODE_RED
|
||||
- _TINY_USB_SOURCE_FILE_
|
||||
:test_preprocess:
|
||||
- *common_defines
|
||||
- _TEST_
|
||||
|
||||
@@ -90,7 +90,7 @@ void tearDown(void)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// keyboard_install, keyboard_no_instances
|
||||
// keyboard_install, keyboard_no_instances, keybaord_init
|
||||
//--------------------------------------------------------------------+
|
||||
void test_keyboard_no_instances_invalid_para(void)
|
||||
{
|
||||
@@ -107,6 +107,16 @@ void test_keyboard_install_ok(void)
|
||||
TEST_ASSERT_EQUAL(1, tusbh_hid_keyboard_no_instances(device_hdl));
|
||||
}
|
||||
|
||||
void test_keyboard_init(void)
|
||||
{
|
||||
class_hid_keyboard_info_t keyboard_info_zero[TUSB_CFG_HOST_DEVICE_MAX];
|
||||
memset(&keyboard_info_zero, 0, sizeof(class_hid_keyboard_info_t)*TUSB_CFG_HOST_DEVICE_MAX);
|
||||
|
||||
class_hid_keyboard_init();
|
||||
|
||||
TEST_ASSERT_EQUAL_MEMORY(keyboard_info_zero, keyboard_info_pool, sizeof(class_hid_keyboard_info_t)*TUSB_CFG_HOST_DEVICE_MAX);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// keyboard_get
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
Reference in New Issue
Block a user