summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/project.yml1
-rw-r--r--tests/test/host/test_hid_host_keyboard.c12
2 files changed, 12 insertions, 1 deletions
diff --git a/tests/project.yml b/tests/project.yml
index be644f147..c33818a15 100644
--- a/tests/project.yml
+++ b/tests/project.yml
@@ -48,6 +48,7 @@
- MCU=MCU_LPC43XX
- CORE_M4
- __CODE_RED
+ - _TINY_USB_SOURCE_FILE_
:test_preprocess:
- *common_defines
- _TEST_
diff --git a/tests/test/host/test_hid_host_keyboard.c b/tests/test/host/test_hid_host_keyboard.c
index 39e4303ac..aab1636fe 100644
--- a/tests/test/host/test_hid_host_keyboard.c
+++ b/tests/test/host/test_hid_host_keyboard.c
@@ -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
//--------------------------------------------------------------------+