summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-07-02 15:32:41 +0700
committerhathach <[email protected]>2013-07-02 15:32:41 +0700
commit7e5c6ded2d8e81912623ac866ba0a3a9f4142abc (patch)
tree5b4273bd9b00b916f81c019794f213ce6d24c62a /tests
parentb04b145965ca9c587ba17c614da694cdf1d8c3a0 (diff)
add tusbh_cdc_serial_is_mounted API
test for cdch close driver
Diffstat (limited to 'tests')
-rw-r--r--tests/lpc18xx_43xx/test/host/cdc/test_cdc_host.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/lpc18xx_43xx/test/host/cdc/test_cdc_host.c b/tests/lpc18xx_43xx/test/host/cdc/test_cdc_host.c
index cd95f3fcd..8bd1d46b7 100644
--- a/tests/lpc18xx_43xx/test/host/cdc/test_cdc_host.c
+++ b/tests/lpc18xx_43xx/test/host/cdc/test_cdc_host.c
@@ -155,6 +155,39 @@ void test_cdch_open_acm_capacity_check(void)
TEST_ASSERT_EQUAL_MEMORY(&cdc_config_descriptor.cdc_acm.bmCapabilities, &p_cdc->acm_capability, 1);
}
+void test_cdch_close_device(void)
+{
+ pipe_handle_t pipe_notification = {
+ .dev_addr = 1,
+ .xfer_type = TUSB_XFER_INTERRUPT
+ };
+
+ pipe_handle_t pipe_out = {
+ .dev_addr = 1,
+ .xfer_type = TUSB_XFER_BULK,
+ .index = 0
+ };
+
+ pipe_handle_t pipe_int = {
+ .dev_addr = 1,
+ .xfer_type = TUSB_XFER_BULK,
+ .index = 1
+ };
+
+ hcd_pipe_open_ExpectAndReturn(dev_addr, p_endpoint_notification, TUSB_CLASS_CDC, pipe_notification);
+ hcd_pipe_open_ExpectAndReturn(dev_addr, p_endpoint_out, TUSB_CLASS_CDC, pipe_out);
+ hcd_pipe_open_ExpectAndReturn(dev_addr, p_endpoint_in, TUSB_CLASS_CDC, pipe_int);
+
+ TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, cdch_open_subtask(dev_addr, p_comm_interface, &length) );
+
+ hcd_pipe_close_ExpectAndReturn(pipe_notification , TUSB_ERROR_NONE);
+ hcd_pipe_close_ExpectAndReturn(pipe_int , TUSB_ERROR_NONE);
+ hcd_pipe_close_ExpectAndReturn(pipe_out , TUSB_ERROR_NONE);
+
+ //------------- CUT -------------//
+ cdch_close(dev_addr);
+}
+