Skip to content

Commit 96e9765

Browse files
fdesbienscodex
andcommitted
test(regression): removed stale Windows accommodations
Removed Windows-specific timer-thread cleanup from testcontrol after the port handled stale host-thread teardown directly. Restored stricter event flag, sleep, and timer expectations where port fixes made the previous Windows accommodations unnecessary. Co-authored-by: Codex (gpt 5.5) <codex@openai.com>
1 parent 9c8828c commit 96e9765

6 files changed

Lines changed: 11 additions & 48 deletions

test/smp/regression/threadx_event_flag_isr_set_clear_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ ULONG actual;
254254
{
255255

256256
/* Test error! */
257-
printf("ERROR #8 (%u %lu %lu)\n", status, condition_count, event_flags_set_counter);
257+
printf("ERROR #8\n");
258258
test_control_return(1);
259259
}
260260

test/smp/regression/threadx_event_flag_suspension_timeout_test.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,7 @@ UINT status;
179179
tx_thread_sleep(63);
180180

181181
/* Check the run counters. */
182-
/* Host scheduling jitter can shift one extra round in these timeout loops. */
183-
if (((thread_1_counter < 32UL) || (thread_1_counter > 33UL)) ||
184-
((thread_2_counter < 13UL) || (thread_2_counter > 14UL)))
182+
if ((thread_1_counter != 33) || (thread_2_counter != 13))
185183
{
186184

187185
/* Event flag error. */

test/tx/regression/testcontrol.c

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -430,37 +430,8 @@ static void init_timer_entry(ULONG timer_input)
430430

431431
void delete_timer_thread(void)
432432
{
433-
#if defined(_WIN32)
434-
HANDLE threadhandle;
435-
HANDLE threadrunsemaphore;
436-
#endif
437433

438434
_tx_thread_terminate(&_tx_timer_thread);
439-
440-
#if defined(_WIN32)
441-
if (_tx_thread_current_ptr == TX_NULL)
442-
{
443-
444-
/* The Windows simulator creates the host thread before the scheduler can run it.
445-
Tear it down directly so the regression hook can force the retry path safely. */
446-
threadhandle = _tx_timer_thread.tx_thread_win32_thread_handle;
447-
threadrunsemaphore = _tx_timer_thread.tx_thread_win32_thread_run_semaphore;
448-
449-
if (threadhandle != ((HANDLE) 0))
450-
{
451-
(void)TerminateThread(threadhandle, 0U);
452-
(void)CloseHandle(threadhandle);
453-
_tx_timer_thread.tx_thread_win32_thread_handle = ((HANDLE) 0);
454-
}
455-
456-
if (threadrunsemaphore != ((HANDLE) 0))
457-
{
458-
(void)CloseHandle(threadrunsemaphore);
459-
_tx_timer_thread.tx_thread_win32_thread_run_semaphore = ((HANDLE) 0);
460-
}
461-
}
462-
#endif
463-
464435
_tx_thread_delete(&_tx_timer_thread);
465436
}
466437

test/tx/regression/threadx_event_flag_isr_set_clear_test.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,14 @@ ULONG actual;
250250
{
251251

252252
/* Suspend on the event_flags that is going to be set via the ISR. */
253-
status = tx_event_flags_get(&event_flags_0, 2, TX_OR_CLEAR, &actual, 100);
253+
status = tx_event_flags_get(&event_flags_0, 2, TX_OR_CLEAR, &actual, 4);
254254

255255
/* Determine if we have an unexpected result. */
256256
if (status != TX_SUCCESS)
257257
{
258258

259259
/* Test error! */
260-
printf("ERROR #8 (%u %lu %lu)\n", status, condition_count, event_flags_set_counter);
260+
printf("ERROR #8\n");
261261
test_control_return(1);
262262
}
263263

@@ -316,7 +316,7 @@ ULONG actual;
316316
{
317317

318318
/* Suspend on the event_flags that is going to be set via the ISR. */
319-
status = tx_event_flags_get(&event_flags_0, 1, TX_OR_CLEAR, &actual, 100);
319+
status = tx_event_flags_get(&event_flags_0, 1, TX_OR_CLEAR, &actual, 4);
320320

321321
/* Determine if we have an unexpected result. */
322322
if (status != TX_SUCCESS)

test/tx/regression/threadx_thread_sleep_for_100ticks_test.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,9 @@ volatile ULONG value = 0;
406406
/* Sleep for 100 ticks. */
407407
status = tx_thread_sleep(100);
408408

409-
/* The Windows host simulator can occasionally resume the sleeping thread
410-
one additional tick later under heavier host-side scheduling jitter. */
409+
/* Determine if the sleep was accurate. */
411410
if ((status != TX_SUCCESS) || (tx_time_get() < 100) ||
412-
(tx_time_get() > 102))
411+
(tx_time_get() > 101))
413412
{
414413

415414
/* Thread Simple Sleep error. */
@@ -433,4 +432,3 @@ volatile ULONG value = 0;
433432
test_control_return(0);
434433
}
435434
}
436-

test/tx/regression/threadx_timer_multiple_test.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -236,17 +236,13 @@ UINT status;
236236
/* Sleep for 200. */
237237
tx_thread_sleep(200);
238238

239-
/* The multiple timer accuracy test validates exact cadence already.
240-
On the Windows host simulator, the waiting test thread can resume
241-
just before or just after the neighboring tick is processed on the
242-
shortest timer periods. */
243-
if ((timer_0_counter < 102) || (timer_0_counter > 104) ||
244-
(timer_1_counter < 52) || (timer_1_counter > 54) ||
245-
(timer_2_counter < 36) || (timer_2_counter > 37))
239+
/* Insure that each timer haven't run again. */
240+
if ((timer_0_counter != 103) || (timer_1_counter != 53) ||
241+
(timer_2_counter != 36))
246242
{
247243

248244
/* Application timer error. */
249-
printf("ERROR #16 (%lu, %lu, %lu)\n", timer_0_counter, timer_1_counter, timer_2_counter);
245+
printf("ERROR #16\n");
250246
test_control_return(1);
251247
}
252248

0 commit comments

Comments
 (0)