diff --git a/tests/test/host/ehci/test_ehci_init.c b/tests/test/host/ehci/test_ehci_init.c index 09e7e7f1b..86103d841 100644 --- a/tests/test/host/ehci/test_ehci_init.c +++ b/tests/test/host/ehci/test_ehci_init.c @@ -61,7 +61,7 @@ static uint8_t hostid; void setUp(void) { ehci_controller_init(); - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, hcd_init()); + TEST_ASSERT_STATUS( hcd_init() ); hostid = RANDOM(CONTROLLER_HOST_NUMBER) + TEST_CONTROLLER_HOST_START_INDEX; } diff --git a/tests/test/host/ehci/test_ehci_isr.c b/tests/test/host/ehci/test_ehci_isr.c index 93a33041f..4f5f040c4 100644 --- a/tests/test/host/ehci/test_ehci_isr.c +++ b/tests/test/host/ehci/test_ehci_isr.c @@ -41,6 +41,7 @@ #include "tusb_option.h" #include "errors.h" #include "binary.h" +#include "type_helper.h" #include "hal.h" #include "ehci.h" @@ -57,7 +58,7 @@ static ehci_registers_t * regs; void setUp(void) { ehci_controller_init(); - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, hcd_init()); + TEST_ASSERT_STATUS( hcd_init()); hostid = RANDOM(CONTROLLER_HOST_NUMBER) + TEST_CONTROLLER_HOST_START_INDEX; regs = get_operational_register(hostid); 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 dea3580e5..f25d0f198 100644 --- a/tests/test/host/ehci/test_ehci_usbh_hcd_integration.c +++ b/tests/test/host/ehci/test_ehci_usbh_hcd_integration.c @@ -41,6 +41,7 @@ #include "tusb_option.h" #include "errors.h" #include "binary.h" +#include "type_helper.h" #include "hal.h" #include "mock_osal.h" @@ -73,7 +74,8 @@ void setUp(void) ehci_controller_init(); - helper_usbh_init(); + helper_usbh_init_expect(); + usbh_init(); helper_usbh_device_emulate(dev_addr, hub_addr, hub_port, hostid, TUSB_SPEED_HIGH); regs = get_operational_register(hostid); @@ -91,11 +93,9 @@ void test_addr0_control_close(void) dev_addr = 0; helper_usbh_device_emulate(0, hub_addr, hub_port, hostid, TUSB_SPEED_HIGH); - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_control_open(dev_addr, control_max_packet_size) ); + TEST_ASSERT_STATUS( hcd_pipe_control_open(dev_addr, control_max_packet_size) ); - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_control_xfer(dev_addr, + TEST_ASSERT_STATUS( hcd_pipe_control_xfer(dev_addr, &(tusb_std_request_t) { .bmRequestType = { .direction = TUSB_DIR_HOST_TO_DEV, .type = TUSB_REQUEST_TYPE_STANDARD, .recipient = TUSB_REQUEST_RECIPIENT_DEVICE }, .bRequest = TUSB_REQUEST_SET_ADDRESS, @@ -103,8 +103,7 @@ void test_addr0_control_close(void) NULL) ) ; ehci_qhd_t *p_qhd = async_head; - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_control_close(dev_addr) ); + TEST_ASSERT_STATUS( hcd_pipe_control_close(dev_addr) ); //------------- Code Under Test -------------// regs->usb_sts_bit.port_change_detect = 0; // clear port change detect @@ -119,11 +118,9 @@ void test_addr0_control_close(void) void test_isr_disconnect_then_async_advance_control_pipe(void) { - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_control_open(dev_addr, control_max_packet_size) ); + TEST_ASSERT_STATUS( hcd_pipe_control_open(dev_addr, control_max_packet_size) ); - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_control_xfer(dev_addr, + TEST_ASSERT_STATUS( hcd_pipe_control_xfer(dev_addr, &(tusb_std_request_t) { .bmRequestType = { .direction = TUSB_DIR_HOST_TO_DEV, .type = TUSB_REQUEST_TYPE_STANDARD, .recipient = TUSB_REQUEST_RECIPIENT_DEVICE }, .bRequest = TUSB_REQUEST_SET_ADDRESS, @@ -163,17 +160,14 @@ void test_bulk_pipe_close(void) uint8_t xfer_data[100]; pipe_handle_t pipe_hdl = hcd_pipe_open(dev_addr, &desc_ept_bulk_in, TUSB_CLASS_MSC); - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_xfer(pipe_hdl, xfer_data, sizeof(xfer_data), 100) ); - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_xfer(pipe_hdl, xfer_data, sizeof(xfer_data), 50) ); + TEST_ASSERT_STATUS( hcd_pipe_xfer(pipe_hdl, xfer_data, sizeof(xfer_data), 100) ); + TEST_ASSERT_STATUS( hcd_pipe_xfer(pipe_hdl, xfer_data, sizeof(xfer_data), 50) ); ehci_qhd_t *p_qhd = &ehci_data.device[dev_addr-1].qhd[pipe_hdl.index]; ehci_qtd_t *p_qtd_head = p_qhd->p_qtd_list_head; ehci_qtd_t *p_qtd_tail = p_qhd->p_qtd_list_tail; - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_close(pipe_hdl) ); + TEST_ASSERT_STATUS( hcd_pipe_close(pipe_hdl) ); //------------- Code Under Test -------------// regs->usb_sts_bit.async_advance = 1; diff --git a/tests/test/host/ehci/test_pipe_bulk_open.c b/tests/test/host/ehci/test_pipe_bulk_open.c index 902aabfcc..75eb16574 100644 --- a/tests/test/host/ehci/test_pipe_bulk_open.c +++ b/tests/test/host/ehci/test_pipe_bulk_open.c @@ -41,6 +41,7 @@ #include "tusb_option.h" #include "errors.h" #include "binary.h" +#include "type_helper.h" #include "hal.h" #include "mock_osal.h" @@ -64,8 +65,7 @@ static ehci_qhd_t *async_head; //--------------------------------------------------------------------+ void setUp(void) { - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_init() ); + TEST_ASSERT_STATUS( hcd_init() ); dev_addr = 1; hostid = RANDOM(CONTROLLER_HOST_NUMBER) + TEST_CONTROLLER_HOST_START_INDEX; diff --git a/tests/test/host/ehci/test_pipe_bulk_xfer.c b/tests/test/host/ehci/test_pipe_bulk_xfer.c index 18cca68c5..e92544cdc 100644 --- a/tests/test/host/ehci/test_pipe_bulk_xfer.c +++ b/tests/test/host/ehci/test_pipe_bulk_xfer.c @@ -41,6 +41,7 @@ #include "tusb_option.h" #include "errors.h" #include "binary.h" +#include "type_helper.h" #include "hal.h" #include "mock_osal.h" @@ -92,8 +93,7 @@ void setUp(void) memclr_(xfer_data, sizeof(xfer_data)); memclr_(usbh_devices, sizeof(usbh_device_info_t)*(TUSB_CFG_HOST_DEVICE_MAX+1)); - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_init() ); + TEST_ASSERT_STATUS( hcd_init() ); dev_addr = 1; hostid = RANDOM(CONTROLLER_HOST_NUMBER) + TEST_CONTROLLER_HOST_START_INDEX; @@ -151,8 +151,7 @@ void test_bulk_xfer_hs_ping_out(void) ehci_qhd_t *p_qhd = qhd_get_from_pipe_handle(pipe_hdl); //------------- Code Under Test -------------// - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_xfer(pipe_hdl, xfer_data, sizeof(xfer_data), true) ); + TEST_ASSERT_STATUS( hcd_pipe_xfer(pipe_hdl, xfer_data, sizeof(xfer_data), true) ); ehci_qtd_t* p_qtd = p_qhd->p_qtd_list_head; TEST_ASSERT(p_qtd->pingstate_err); @@ -161,8 +160,7 @@ void test_bulk_xfer_hs_ping_out(void) void test_bulk_xfer(void) { //------------- Code Under Test -------------// - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_xfer(pipe_hdl_bulk, xfer_data, sizeof(xfer_data), true) ); + TEST_ASSERT_STATUS( hcd_pipe_xfer(pipe_hdl_bulk, xfer_data, sizeof(xfer_data), true) ); ehci_qtd_t* p_qtd = p_qhd_bulk->p_qtd_list_head; TEST_ASSERT_NOT_NULL(p_qtd); @@ -177,11 +175,9 @@ void test_bulk_xfer(void) void test_bulk_xfer_double(void) { //------------- Code Under Test -------------// - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_xfer(pipe_hdl_bulk, xfer_data, sizeof(xfer_data), false) ); + TEST_ASSERT_STATUS( hcd_pipe_xfer(pipe_hdl_bulk, xfer_data, sizeof(xfer_data), false) ); - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_xfer(pipe_hdl_bulk, data2, sizeof(data2), true) ); + TEST_ASSERT_STATUS( hcd_pipe_xfer(pipe_hdl_bulk, data2, sizeof(data2), true) ); ehci_qtd_t* p_head = p_qhd_bulk->p_qtd_list_head; ehci_qtd_t* p_tail = p_qhd_bulk->p_qtd_list_tail; @@ -205,11 +201,9 @@ void test_bulk_xfer_double(void) void test_bulk_xfer_complete_isr(void) { - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_xfer(pipe_hdl_bulk, xfer_data, sizeof(xfer_data), false) ); + TEST_ASSERT_STATUS( hcd_pipe_xfer(pipe_hdl_bulk, xfer_data, sizeof(xfer_data), false) ); - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_xfer(pipe_hdl_bulk, data2, sizeof(data2), true) ); + TEST_ASSERT_STATUS( hcd_pipe_xfer(pipe_hdl_bulk, data2, sizeof(data2), true) ); ehci_qtd_t* p_head = p_qhd_bulk->p_qtd_list_head; ehci_qtd_t* p_tail = p_qhd_bulk->p_qtd_list_tail; diff --git a/tests/test/host/ehci/test_pipe_control_open.c b/tests/test/host/ehci/test_pipe_control_open.c index 6a933da06..7cfdec4bb 100644 --- a/tests/test/host/ehci/test_pipe_control_open.c +++ b/tests/test/host/ehci/test_pipe_control_open.c @@ -41,6 +41,7 @@ #include "tusb_option.h" #include "errors.h" #include "binary.h" +#include "type_helper.h" #include "hal.h" #include "mock_osal.h" @@ -68,8 +69,7 @@ void setUp(void) { memclr_(usbh_devices, sizeof(usbh_device_info_t)*(TUSB_CFG_HOST_DEVICE_MAX+1)); - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_init() ); + TEST_ASSERT_STATUS( hcd_init() ); dev_addr = 1; hostid = RANDOM(CONTROLLER_HOST_NUMBER) + TEST_CONTROLLER_HOST_START_INDEX; @@ -127,8 +127,7 @@ void test_control_open_addr0_qhd_data(void) dev_addr = 0; //------------- Code Under Test -------------// - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_control_open(dev_addr, control_max_packet_size) ); + TEST_ASSERT_STATUS( hcd_pipe_control_open(dev_addr, control_max_packet_size) ); verify_control_open_qhd(async_head); TEST_ASSERT(async_head->head_list_flag); @@ -137,8 +136,7 @@ void test_control_open_addr0_qhd_data(void) void test_control_open_qhd_data(void) { //------------- Code Under TEST -------------// - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_control_open(dev_addr, control_max_packet_size)); + TEST_ASSERT_STATUS( hcd_pipe_control_open(dev_addr, control_max_packet_size)); verify_control_open_qhd(p_control_qhd); TEST_ASSERT_FALSE(p_control_qhd->head_list_flag); @@ -154,8 +152,7 @@ void test_control_open_highspeed(void) usbh_devices[dev_addr].speed = TUSB_SPEED_HIGH; //------------- Code Under TEST -------------// - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_control_open(dev_addr, control_max_packet_size) ); + TEST_ASSERT_STATUS( hcd_pipe_control_open(dev_addr, control_max_packet_size) ); TEST_ASSERT_FALSE(p_control_qhd->non_hs_control_endpoint); } @@ -164,8 +161,7 @@ void test_control_open_non_highspeed(void) usbh_devices[dev_addr].speed = TUSB_SPEED_FULL; //------------- Code Under TEST -------------// - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_control_open(dev_addr, control_max_packet_size) ); + TEST_ASSERT_STATUS( hcd_pipe_control_open(dev_addr, control_max_packet_size) ); TEST_ASSERT_TRUE(p_control_qhd->non_hs_control_endpoint); } @@ -176,12 +172,10 @@ void test_control_open_non_highspeed(void) void test_control_addr0_close(void) { dev_addr = 0; - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_control_open(dev_addr, control_max_packet_size) ); + TEST_ASSERT_STATUS( hcd_pipe_control_open(dev_addr, control_max_packet_size) ); //------------- Code Under Test -------------// - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_control_close(dev_addr) ); + TEST_ASSERT_STATUS( hcd_pipe_control_close(dev_addr) ); TEST_ASSERT(async_head->head_list_flag); TEST_ASSERT(async_head->is_removing); @@ -189,12 +183,10 @@ void test_control_addr0_close(void) void test_control_close(void) { - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_control_open(dev_addr, control_max_packet_size) ); + TEST_ASSERT_STATUS( hcd_pipe_control_open(dev_addr, control_max_packet_size) ); //------------- Code Under TEST -------------// - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_control_close(dev_addr) ); + TEST_ASSERT_STATUS( hcd_pipe_control_close(dev_addr) ); TEST_ASSERT(p_control_qhd->is_removing); TEST_ASSERT(p_control_qhd->used); diff --git a/tests/test/host/ehci/test_pipe_control_xfer.c b/tests/test/host/ehci/test_pipe_control_xfer.c index 476a5d8ed..605fd9107 100644 --- a/tests/test/host/ehci/test_pipe_control_xfer.c +++ b/tests/test/host/ehci/test_pipe_control_xfer.c @@ -41,6 +41,7 @@ #include "tusb_option.h" #include "errors.h" #include "binary.h" +#include "type_helper.h" #include "hal.h" #include "mock_osal.h" @@ -76,8 +77,7 @@ void setUp(void) memclr_(usbh_devices, sizeof(usbh_device_info_t)*(TUSB_CFG_HOST_DEVICE_MAX+1)); memclr_(xfer_data, sizeof(xfer_data)); - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_init() ); + TEST_ASSERT_STATUS( hcd_init() ); dev_addr = 1; hostid = RANDOM(CONTROLLER_HOST_NUMBER) + TEST_CONTROLLER_HOST_START_INDEX; @@ -88,8 +88,7 @@ void setUp(void) async_head = get_async_head( hostid ); //------------- pipe open -------------// - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_control_open(dev_addr, control_max_packet_size) ); + TEST_ASSERT_STATUS( hcd_pipe_control_open(dev_addr, control_max_packet_size) ); p_control_qhd = &ehci_data.device[dev_addr-1].control.qhd; @@ -147,12 +146,10 @@ void test_control_addr0_xfer_get_check_qhd_qtd_mapping(void) dev_addr = 0; ehci_qhd_t * const p_qhd = async_head; - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_control_open(dev_addr, control_max_packet_size) ); + TEST_ASSERT_STATUS( hcd_pipe_control_open(dev_addr, control_max_packet_size) ); //------------- Code Under TEST -------------// - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_control_xfer(dev_addr, &request_get_dev_desc, xfer_data) ); + TEST_ASSERT_STATUS( hcd_pipe_control_xfer(dev_addr, &request_get_dev_desc, xfer_data) ); p_setup = &ehci_data.addr0_qtd[0]; p_data = &ehci_data.addr0_qtd[1]; @@ -173,8 +170,7 @@ void test_control_addr0_xfer_get_check_qhd_qtd_mapping(void) void test_control_xfer_get(void) { //------------- Code Under TEST -------------// - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_control_xfer(dev_addr, &request_get_dev_desc, xfer_data) ); + TEST_ASSERT_STATUS( hcd_pipe_control_xfer(dev_addr, &request_get_dev_desc, xfer_data) ); TEST_ASSERT_EQUAL_HEX( p_setup, p_control_qhd->qtd_overlay.next.address ); TEST_ASSERT_EQUAL_HEX( p_setup , p_control_qhd->p_qtd_list_head); @@ -209,8 +205,7 @@ void test_control_xfer_get(void) void test_control_xfer_set(void) { //------------- Code Under TEST -------------// - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_control_xfer(dev_addr, &request_set_dev_addr, xfer_data) ); + TEST_ASSERT_STATUS( hcd_pipe_control_xfer(dev_addr, &request_set_dev_addr, xfer_data) ); TEST_ASSERT_EQUAL_HEX( p_setup, p_control_qhd->qtd_overlay.next.address ); TEST_ASSERT_EQUAL_HEX( p_setup , p_control_qhd->p_qtd_list_head); @@ -230,8 +225,7 @@ void test_control_xfer_set(void) void test_control_xfer_complete_isr(void) { - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_control_xfer(dev_addr, &request_get_dev_desc, xfer_data) ); + TEST_ASSERT_STATUS( hcd_pipe_control_xfer(dev_addr, &request_get_dev_desc, xfer_data) ); usbh_isr_Expect(((pipe_handle_t){.dev_addr = dev_addr}), 0, TUSB_EVENT_XFER_COMPLETE); @@ -249,8 +243,7 @@ void test_control_xfer_complete_isr(void) void test_control_xfer_error_isr(void) { - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_control_xfer(dev_addr, &request_get_dev_desc, xfer_data) ); + TEST_ASSERT_STATUS( hcd_pipe_control_xfer(dev_addr, &request_get_dev_desc, xfer_data) ); usbh_isr_Expect(((pipe_handle_t){.dev_addr = dev_addr}), 0, TUSB_EVENT_XFER_ERROR); diff --git a/tests/test/host/ehci/test_pipe_interrupt_open.c b/tests/test/host/ehci/test_pipe_interrupt_open.c index 0b84440e0..172ac6f43 100644 --- a/tests/test/host/ehci/test_pipe_interrupt_open.c +++ b/tests/test/host/ehci/test_pipe_interrupt_open.c @@ -40,6 +40,7 @@ #include "tusb_option.h" #include "errors.h" #include "binary.h" +#include "type_helper.h" #include "hal.h" #include "mock_osal.h" diff --git a/tests/test/host/ehci/test_pipe_interrupt_xfer.c b/tests/test/host/ehci/test_pipe_interrupt_xfer.c index aaa1e213d..1abb00e24 100644 --- a/tests/test/host/ehci/test_pipe_interrupt_xfer.c +++ b/tests/test/host/ehci/test_pipe_interrupt_xfer.c @@ -41,6 +41,7 @@ #include "tusb_option.h" #include "errors.h" #include "binary.h" +#include "type_helper.h" #include "hal.h" #include "mock_osal.h" @@ -93,8 +94,7 @@ void setUp(void) memclr_(usbh_devices, sizeof(usbh_device_info_t)*(TUSB_CFG_HOST_DEVICE_MAX+1)); memclr_(xfer_data, sizeof(xfer_data)); - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_init() ); + TEST_ASSERT_STATUS( hcd_init() ); dev_addr = 1; hostid = RANDOM(CONTROLLER_HOST_NUMBER) + TEST_CONTROLLER_HOST_START_INDEX; @@ -148,8 +148,7 @@ void verify_qtd(ehci_qtd_t *p_qtd, uint8_t p_data[], uint16_t length) void test_interrupt_xfer(void) { //------------- Code Under Test -------------// - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_xfer(pipe_hdl_interrupt, xfer_data, sizeof(xfer_data), true) ); + TEST_ASSERT_STATUS( hcd_pipe_xfer(pipe_hdl_interrupt, xfer_data, sizeof(xfer_data), true) ); ehci_qtd_t* p_qtd = p_qhd_interrupt->p_qtd_list_head; TEST_ASSERT_NOT_NULL(p_qtd); @@ -164,11 +163,9 @@ void test_interrupt_xfer(void) void test_interrupt_xfer_double(void) { //------------- Code Under Test -------------// - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_xfer(pipe_hdl_interrupt, xfer_data, sizeof(xfer_data), false) ); + TEST_ASSERT_STATUS( hcd_pipe_xfer(pipe_hdl_interrupt, xfer_data, sizeof(xfer_data), false) ); - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_xfer(pipe_hdl_interrupt, data2, sizeof(data2), true) ); + TEST_ASSERT_STATUS( hcd_pipe_xfer(pipe_hdl_interrupt, data2, sizeof(data2), true) ); ehci_qtd_t* p_head = p_qhd_interrupt->p_qtd_list_head; ehci_qtd_t* p_tail = p_qhd_interrupt->p_qtd_list_tail; @@ -199,11 +196,9 @@ void check_qhd_after_complete(ehci_qhd_t *p_qhd) void test_interrupt_xfer_complete_isr_interval_less_than_1ms(void) { - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_xfer(pipe_hdl_interrupt, xfer_data, sizeof(xfer_data), false) ); + TEST_ASSERT_STATUS( hcd_pipe_xfer(pipe_hdl_interrupt, xfer_data, sizeof(xfer_data), false) ); - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_xfer(pipe_hdl_interrupt, data2, sizeof(data2), true) ); + TEST_ASSERT_STATUS( hcd_pipe_xfer(pipe_hdl_interrupt, data2, sizeof(data2), true) ); usbh_isr_Expect(pipe_hdl_interrupt, TUSB_CLASS_HID, TUSB_EVENT_XFER_COMPLETE); @@ -226,8 +221,7 @@ void test_interrupt_xfer_complete_isr_interval_2ms(void) pipe_handle_t pipe_hdl_2ms = hcd_pipe_open(dev_addr, &desc_endpoint_2ms, TUSB_CLASS_HID); ehci_qhd_t * p_qhd_2ms = &ehci_data.device[ dev_addr -1].qhd[ pipe_hdl_2ms.index ]; - TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, - hcd_pipe_xfer(pipe_hdl_2ms, xfer_data, sizeof(xfer_data), false) ); + TEST_ASSERT_STATUS( hcd_pipe_xfer(pipe_hdl_2ms, xfer_data, sizeof(xfer_data), false) ); ehci_qtd_t* p_head = p_qhd_2ms->p_qtd_list_head; ehci_qtd_t* p_tail = p_qhd_2ms->p_qtd_list_tail; diff --git a/tests/test/host/ehci/test_pipe_isochronous_open.c b/tests/test/host/ehci/test_pipe_isochronous_open.c index df3b407fe..be1b7dfb4 100644 --- a/tests/test/host/ehci/test_pipe_isochronous_open.c +++ b/tests/test/host/ehci/test_pipe_isochronous_open.c @@ -40,6 +40,7 @@ #include "tusb_option.h" #include "errors.h" #include "binary.h" +#include "type_helper.h" #include "hal.h" #include "mock_osal.h" diff --git a/tests/test/host/host_helper.h b/tests/test/host/host_helper.h index 209ae58f6..502cd3288 100644 --- a/tests/test/host/host_helper.h +++ b/tests/test/host/host_helper.h @@ -45,14 +45,12 @@ static inline void class_init_expect(void) //TODO update more classes } -static inline void helper_usbh_init(void) +static inline void helper_usbh_init_expect(void) { 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(); } static inline void helper_usbh_device_emulate(uint8_t dev_addr, uint8_t hub_addr, uint8_t hub_port, uint8_t hostid, tusb_speed_t speed) diff --git a/tests/test/support/type_helper.h b/tests/test/support/type_helper.h index 9e73bc11a..f8d5090a0 100644 --- a/tests/test/support/type_helper.h +++ b/tests/test/support/type_helper.h @@ -66,6 +66,9 @@ for (uint32_t i=0; i