Module: wine Branch: master Commit: 195ff4bce75915bbed5b217af100c696ed42a604 URL: https://gitlab.winehq.org/wine/wine/-/commit/195ff4bce75915bbed5b217af100c69...
Author: Piotr Caban piotr@codeweavers.com Date: Wed Aug 23 14:38:57 2023 +0200
msvcr90/tests: Reorder locale refcount tests to workaround leak in _create_locale.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54718
---
dlls/msvcr90/tests/msvcr90.c | 7 +++++-- dlls/msvcrt/locale.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/dlls/msvcr90/tests/msvcr90.c b/dlls/msvcr90/tests/msvcr90.c index 506ec5931d2..0b274fd694f 100644 --- a/dlls/msvcr90/tests/msvcr90.c +++ b/dlls/msvcr90/tests/msvcr90.c @@ -2380,7 +2380,7 @@ static void test__get_current_locale(void) ok(l->locinfo->lc_time_curr->unk == 1, "unk = %d\n", l->locinfo->lc_time_curr->unk); ok(l->locinfo->lc_time_curr->refcount == 1, "refcount = %d\n", l->locinfo->lc_time_curr->refcount); ok(l2->locinfo->lc_time_curr->unk == 1, "unk = %d\n", l2->locinfo->lc_time_curr->unk); - ok(l2->locinfo->lc_time_curr->refcount == 3 || broken(l2->locinfo->lc_time_curr->refcount == 2), + ok(l2->locinfo->lc_time_curr->refcount == 2, "refcount = %d\n", l2->locinfo->lc_time_curr->refcount);
p__free_locale(l2); @@ -2491,6 +2491,10 @@ START_TEST(msvcr90) if(!init()) return;
+ /* _get_current_locale tests needs to be run first because there's + * a C-locale refcount leak in native _create_locale implementation. */ + test__get_current_locale(); + test__initterm_e(); test__encode_pointer(); test_error_messages(); @@ -2526,7 +2530,6 @@ START_TEST(msvcr90) test___strncnt(); test_swscanf(); test____mb_cur_max_l_func(); - test__get_current_locale(); test_ioinfo_flags(); test_strcmp(); } diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c index 82083d66106..f7be2a1e9bc 100644 --- a/dlls/msvcrt/locale.c +++ b/dlls/msvcrt/locale.c @@ -68,7 +68,7 @@ __lc_time_data cloc_time_data = #if _MSVCR_VER < 110 MAKELCID(LANG_ENGLISH, SORT_DEFAULT), #endif - 1, 0, + 1, -1, #if _MSVCR_VER == 0 || _MSVCR_VER >= 100 {{L"Sun", L"Mon", L"Tue", L"Wed", L"Thu", L"Fri", L"Sat", L"Sunday", L"Monday", L"Tuesday", L"Wednesday", L"Thursday", L"Friday", L"Saturday",