1 /* This tests the case where the port reset fails because the hub never reports that the port was RESET.
2    The specific test case is in ux_host_class_hub_port_reset.c. */
3 
4 #include "usbx_ux_test_hub.h"
5 
6 /* Define what the initial system looks like.  */
7 
8 #ifdef CTEST
test_application_define(void * first_unused_memory)9 void test_application_define(void *first_unused_memory)
10 #else
11 void usbx_hub_port_reset_fails_due_to_unset_port_enabled_bit_test_application_define(void *first_unused_memory)
12 #endif
13 {
14 
15     /* Inform user.  */
16     printf("Running Hub Port Reset Fails Due To Unset Port Enabled Bit Test..... ");
17 
18     stepinfo("\n");
19 
20     initialize_hub(first_unused_memory);
21 }
22 
post_init_host()23 static void post_init_host()
24 {
25 #if UX_MAX_DEVICES > 1
26     /* Make sure it is never reset. */
27     g_hub_device->dont_reset_port_when_commanded_to = 1;
28     ux_test_add_action_to_main_list(create_error_match_action(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_HUB, UX_PORT_RESET_FAILED));
29     connect_device_to_hub();
30     /* Wait for enum thread to pick it up. */
31     tx_thread_sleep(100);
32     ux_test_wait_for_enum_thread_completion();
33     UX_TEST_ASSERT(g_dpump_host_from_system_change_function == UX_NULL);
34 
35     /* USBX still thinks there's a device connected (since there is, technically), so it will try to remove it, but fail. */
36     ux_test_add_action_to_main_list(create_error_match_action(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_ENUMERATOR, UX_DEVICE_HANDLE_UNKNOWN));
37 #endif
38 }
39 
post_init_device()40 static void post_init_device()
41 {
42 }