From 795fe7468d35b62987cee07d35c7cf452447ea70 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 28 Feb 2013 17:00:51 +0700 Subject: [PATCH] start to add code for hcd_init test change hcd_init signature (omit hostid) --- tests/test/host/ehci/test_ehci.c | 19 ++++++++++++++++++- tests/test/host/test_usbh.c | 12 +++--------- tinyusb/common/common.h | 9 --------- tinyusb/common/compiler/compiler.h | 10 ++++++++++ tinyusb/common/compiler/compiler_gcc.h | 2 ++ tinyusb/host/hcd.h | 2 +- tinyusb/host/usbh.c | 5 +---- 7 files changed, 35 insertions(+), 24 deletions(-) diff --git a/tests/test/host/ehci/test_ehci.c b/tests/test/host/ehci/test_ehci.c index ec7f821a5..2c6797109 100644 --- a/tests/test/host/ehci/test_ehci.c +++ b/tests/test/host/ehci/test_ehci.c @@ -42,6 +42,9 @@ #include "mock_osal.h" #include "ehci.h" +extern ehci_data_t ehci_data; +extern ehci_link_t period_frame_list0[EHCI_FRAMELIST_SIZE]; +extern ehci_link_t period_frame_list1[EHCI_FRAMELIST_SIZE]; //--------------------------------------------------------------------+ // Setup/Teardown + helper declare @@ -281,9 +284,23 @@ void test_register_portsc(void) //--------------------------------------------------------------------+ // EHCI Data Organization //--------------------------------------------------------------------+ -void test_(void) +void test_ehci_data(void) { + // period fram list alignment + TEST_ASSERT_BITS_LOW(4096-1, (uint32_t)period_frame_list0 ); + TEST_ASSERT_BITS_LOW(4096-1, (uint32_t)period_frame_list1 ); + // +} + +void test_hcd_init(void) +{ + hcd_init(0); + + //------------- check memory data -------------// + ehci_data_t zeroes; + memclr_(&zeroes, sizeof(ehci_data_t)); + TEST_ASSERT_EQUAL_MEMORY(&zeroes, &ehci_data, sizeof(ehci_data_t)); } //--------------------------------------------------------------------+ diff --git a/tests/test/host/test_usbh.c b/tests/test/host/test_usbh.c index 3ca029219..e8b38eda6 100644 --- a/tests/test/host/test_usbh.c +++ b/tests/test/host/test_usbh.c @@ -78,12 +78,6 @@ void test_usbh_status_get_succeed(void) //--------------------------------------------------------------------+ // Init //--------------------------------------------------------------------+ -void hcd_init_expect(void) -{ - for(uint32_t i=0; i