Dec. 31, 2023
11:42 a.m.
Piotr Caban (@piotr) commented about dlls/msvcrt/tests/locale.c:
> + const char* locale = NULL;
> + if (*(int*)arg % 2) locale = "German_Germany.1252";
> + setlocale(LC_NUMERIC, locale);
> + return 0;
> +}
> +
> +static void test_setlocale_threads(void)
> +{
> + HANDLE threads[100];
> + for (int i = 0; i < ARRAY_SIZE(threads); i++)
> + {
> + threads[i] = CreateThread(NULL, 0, test_setlocale_threads_proc, (void*)&i, 0, NULL);
> + ok(threads[i] != NULL, "CreateThread failed\n");
> + }
> + WaitForMultipleObjects(ARRAY_SIZE(threads), threads, TRUE, INFINITE);
> +}
The test needs more work:
- you should pass `i` as argument (not `&i`)
- ARRAY_SIZE(threads) is bigger than MAXIMUM_WAIT_OBJECTS
- I think the test will be better if only 2 threads are created
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4654#note_56510