From b0ff7a7e235b1901def71305e6c35e6c3cda222c Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 26 Mar 2013 17:04:55 +0700 Subject: add code & test for hidh_isr (set status for keyboard) --- tests/test/host/hid/test_hid_host.c | 8 -------- tests/test/host/hid/test_hidh_keyboard.c | 9 +++++++++ 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'tests/test/host') diff --git a/tests/test/host/hid/test_hid_host.c b/tests/test/host/hid/test_hid_host.c index 8c53fa083..f96f20eb2 100644 --- a/tests/test/host/hid/test_hid_host.c +++ b/tests/test/host/hid/test_hid_host.c @@ -72,7 +72,6 @@ void test_hidh_open_ok(void) { uint16_t length=0; - // TODO expect get HID report descriptor hcd_pipe_open_IgnoreAndReturn( pipe_hdl ); @@ -95,10 +94,3 @@ void test_hidh_close(void) TEST_ASSERT_MEM_ZERO(&keyboard_data[dev_addr-1], sizeof(hidh_keyboard_info_t)); } - -void test_hihd_isr(void) -{ - TEST_IGNORE(); - //------------- Code Under TEST -------------// -// hidh_isr() -} diff --git a/tests/test/host/hid/test_hidh_keyboard.c b/tests/test/host/hid/test_hidh_keyboard.c index 101cc0bb9..9e95f0aa0 100644 --- a/tests/test/host/hid/test_hidh_keyboard.c +++ b/tests/test/host/hid/test_hidh_keyboard.c @@ -187,3 +187,12 @@ void test_keyboard_get_ok() tusbh_device_get_state_IgnoreAndReturn(TUSB_DEVICE_STATE_CONFIGURED); TEST_ASSERT_EQUAL(TUSB_INTERFACE_STATUS_BUSY, tusbh_hid_keyboard_status(dev_addr, 0)); } + +void test_keyboard_isr_event_complete(void) +{ + //------------- Code Under TEST -------------// + hidh_isr(p_hidh_kbd->pipe_hdl, BUS_EVENT_XFER_COMPLETE); + + tusbh_device_get_state_IgnoreAndReturn(TUSB_DEVICE_STATE_CONFIGURED); + TEST_ASSERT_EQUAL(TUSB_INTERFACE_STATUS_COMPLETE, tusbh_hid_keyboard_status(dev_addr, 0)); +} -- cgit v1.3.1