From e0aa3c1fca1b9da31c89bc8b7ff6bdbe0ef6817e Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 13 May 2013 22:36:49 +0700 Subject: [PATCH] adding helper to refractor tests --- .../ehci/test_ehci_usbh_hcd_integration.c | 25 ++----- tests/test/host/host_helper.h | 71 +++++++++++++++++++ 2 files changed, 76 insertions(+), 20 deletions(-) create mode 100644 tests/test/host/host_helper.h 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 cfbc5485d..dea3580e5 100644 --- a/tests/test/host/ehci/test_ehci_usbh_hcd_integration.c +++ b/tests/test/host/ehci/test_ehci_usbh_hcd_integration.c @@ -51,22 +51,19 @@ #include "usbh.h" #include "ehci.h" #include "ehci_controller_fake.h" +#include "host_helper.h" static uint8_t const control_max_packet_size = 64; static uint8_t hub_addr; static uint8_t hub_port; static uint8_t dev_addr; static uint8_t hostid; + static ehci_registers_t * regs; static ehci_qhd_t *async_head; static ehci_qhd_t *period_head_arr; -void class_init_expect(void) -{ - hidh_init_Expect(); - //TODO update more classes -} void setUp(void) { @@ -76,21 +73,8 @@ void setUp(void) ehci_controller_init(); - osal_semaphore_create_IgnoreAndReturn( (osal_semaphore_handle_t) 0x1234); - osal_task_create_IgnoreAndReturn(TUSB_ERROR_NONE); - osal_queue_create_IgnoreAndReturn( (osal_queue_handle_t) 0x4566 ); - class_init_expect(); - - usbh_init(); - - for (uint8_t i=0; i