add code & test for hidh_isr (set status for keyboard)

This commit is contained in:
hathach
2013-03-26 17:04:55 +07:00
parent ac905a8d09
commit b0ff7a7e23
4 changed files with 46 additions and 24 deletions

View File

@@ -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()
}

View File

@@ -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));
}