summaryrefslogtreecommitdiff
path: root/tests/test
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-03-25 10:56:51 +0700
committerhathach <[email protected]>2013-03-25 11:04:37 +0700
commit20a22d956d1884f0359e0fd0d57dca8ea30b78b1 (patch)
tree99ece866638331135f4867ba3feb79bbe883fb26 /tests/test
parentb15694bc5fe9ddf076156cb03eb5a25cb7f80f5b (diff)
changing the hcd_pipe_close behavior
- bulk/int/iso pipe can only be closed as part of unmount/safe remove process add test for interrupt_close
Diffstat (limited to 'tests/test')
-rw-r--r--tests/test/host/ehci/test_ehci_usbh_hcd_integration.c9
-rw-r--r--tests/test/host/ehci/test_pipe_bulk_open.c5
-rw-r--r--tests/test/host/ehci/test_pipe_interrupt_open.c10
3 files changed, 12 insertions, 12 deletions
diff --git a/tests/test/host/ehci/test_ehci_usbh_hcd_integration.c b/tests/test/host/ehci/test_ehci_usbh_hcd_integration.c
index da451d2d1..5931bcd83 100644
--- a/tests/test/host/ehci/test_ehci_usbh_hcd_integration.c
+++ b/tests/test/host/ehci/test_ehci_usbh_hcd_integration.c
@@ -141,8 +141,8 @@ void test_isr_disconnect_then_async_advance_control_pipe(void)
TEST_ASSERT_FALSE(p_qhd->used);
TEST_ASSERT_FALSE(p_qhd->is_removing);
- TEST_ASSERT_NULL(p_qhd->p_qtd_list_head);
- TEST_ASSERT_NULL(p_qhd->p_qtd_list_tail);
+// TEST_ASSERT_NULL(p_qhd->p_qtd_list_head);
+// TEST_ASSERT_NULL(p_qhd->p_qtd_list_tail);
}
void test_bulk_pipe_close(void)
@@ -170,12 +170,13 @@ void test_bulk_pipe_close(void)
//------------- Code Under Test -------------//
regs->usb_sts_bit.async_advance = 1;
+ get_control_qhd(dev_addr)->is_removing = 1; // mimic unmount
hcd_isr(hostid); // async advance
TEST_ASSERT_FALSE(p_qhd->used);
TEST_ASSERT_FALSE(p_qhd->is_removing);
- TEST_ASSERT_NULL(p_qhd->p_qtd_list_head);
- TEST_ASSERT_NULL(p_qhd->p_qtd_list_tail);
+// TEST_ASSERT_NULL(p_qhd->p_qtd_list_head);
+// TEST_ASSERT_NULL(p_qhd->p_qtd_list_tail);
TEST_ASSERT_FALSE(p_qtd_head->used);
TEST_ASSERT_FALSE(p_qtd_tail->used);
}
diff --git a/tests/test/host/ehci/test_pipe_bulk_open.c b/tests/test/host/ehci/test_pipe_bulk_open.c
index 5fc08e30a..170a9ceac 100644
--- a/tests/test/host/ehci/test_pipe_bulk_open.c
+++ b/tests/test/host/ehci/test_pipe_bulk_open.c
@@ -175,6 +175,7 @@ void test_bulk_close(void)
hcd_pipe_close(pipe_hdl);
TEST_ASSERT(p_qhd->is_removing);
- TEST_ASSERT( align32(get_async_head(hostid)->next.address) != (uint32_t) p_qhd );
- TEST_ASSERT_EQUAL_HEX( (uint32_t) get_async_head(hostid), align32(p_qhd->next.address ) );
+ TEST_ASSERT( align32(async_head->next.address) != (uint32_t) p_qhd );
+ TEST_ASSERT_EQUAL_HEX( (uint32_t) async_head, align32(p_qhd->next.address) );
+ TEST_ASSERT_EQUAL(EHCI_QUEUE_ELEMENT_QHD, p_qhd->next.type);
}
diff --git a/tests/test/host/ehci/test_pipe_interrupt_open.c b/tests/test/host/ehci/test_pipe_interrupt_open.c
index 8cf656c26..18d36ff33 100644
--- a/tests/test/host/ehci/test_pipe_interrupt_open.c
+++ b/tests/test/host/ehci/test_pipe_interrupt_open.c
@@ -191,10 +191,8 @@ void test_interrupt_close(void)
//------------- Code Under TEST -------------//
hcd_pipe_close(pipe_hdl);
- TEST_IGNORE(); // check operation removing interrupt head
-
-// TEST_ASSERT(p_qhd->is_removing);
-// TEST_ASSERT( align32(period_head) != (uint32_t) p_qhd );
-// TEST_ASSERT_EQUAL_HEX( (uint32_t) get_async_head(hostid), align32(p_qhd->next.address ) );
-
+ TEST_ASSERT(p_qhd->is_removing);
+ TEST_ASSERT( align32(period_head->next.address) != (uint32_t) p_qhd );
+ TEST_ASSERT_EQUAL_HEX( (uint32_t) period_head, align32(p_qhd->next.address ) );
+ TEST_ASSERT_EQUAL(EHCI_QUEUE_ELEMENT_QHD, p_qhd->next.type);
}