File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
components/wpa_supplicant/test_apps/main Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 11/*
2- * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
2+ * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
33 *
44 * SPDX-License-Identifier: Unlicense OR CC0-1.0
55 */
@@ -25,7 +25,6 @@ static int executed_order[6];
2525static int t ;
2626static struct os_reltime ts ;
2727
28-
2928/* there is only single instance of esp_timer so no need of protection */
3029static void callback (void * a , void * b )
3130{
@@ -80,6 +79,15 @@ TEST_CASE("Test eloop timers run", "[eloop]")
8079 os_sleep (20 , 0 );
8180 /* check the execution order, this will also check whether they were fired at correct time */
8281 TEST_ASSERT (memcmp (execution_order , executed_order , 6 * sizeof (int )) == 0 );
82+
83+ /* Add timers to check deinit happens gracefully */
84+ for (int i = 0 ; i < 6 ; i ++ ) {
85+ eloop_register_timeout (timeouts_sec [i ], timeouts_usec [i ],
86+ callback , & index [i ], NULL );
87+ }
88+
89+ /* Stop wifi before all the timers have run */
90+ os_sleep (2 , 0 );
8391 TEST_ESP_OK (esp_wifi_stop ());
8492 TEST_ESP_OK (esp_wifi_deinit ());
8593 os_sleep (3 , 0 );
You can’t perform that action at this time.
0 commit comments