diff options
| author | hathach <[email protected]> | 2013-03-26 17:04:55 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-03-26 17:04:55 +0700 |
| commit | b0ff7a7e235b1901def71305e6c35e6c3cda222c (patch) | |
| tree | 37a3bf521d8f22d73af16e55f45a3069d0c02170 /tests | |
| parent | ac905a8d09598067c53ff32835a2d70797d970be (diff) | |
add code & test for hidh_isr (set status for keyboard)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test/host/hid/test_hid_host.c | 8 | ||||
| -rw-r--r-- | tests/test/host/hid/test_hidh_keyboard.c | 9 |
2 files changed, 9 insertions, 8 deletions
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)); +} |
