[PATCH 0/1] MR5196: comctl32: Fix test that fails on Feb 29th.
The tests on line 495, 498 and 499 in the file `dlls/comctl32/tests/monthcal.c` fail on February 29th of a leap year. The failure originates from the line 484 `st[1].wYear++;` where a year is added to the current date making it for example Feb 29th 2025. This will then produce a failure in the handling of the message. Specifically, the function call to `MONTHCAL_ValidateDate(&range[1])` in the function `MONTHCAL_SetRange` in the file `/dlls/comctl32/monthcal.c` will return `FALSE`. Note that the source code is handling the leap year correctly. It is only the test that fails incorrectly. The fix on the new line 472 is technically not necessary, since the limits of that test message are 0 and thus the date is not checked for validity. However, it was included in this patch for completeness. Happy leap year :smile: -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5196
From: Noah Berner <noah(a)berner.io> --- dlls/comctl32/tests/monthcal.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/comctl32/tests/monthcal.c b/dlls/comctl32/tests/monthcal.c index 58060e66e35..5460e30dfc4 100644 --- a/dlls/comctl32/tests/monthcal.c +++ b/dlls/comctl32/tests/monthcal.c @@ -469,6 +469,7 @@ static void test_monthcal(void) ok(limits == GDTR_MIN, "got 0x%08lx\n", limits); GetSystemTime(st); + st[0].wDay = 25; st[1] = st[0]; st[1].wYear++; r = SendMessageA(hwnd, MCM_SETRANGE, 0, (LPARAM)st); @@ -480,6 +481,7 @@ static void test_monthcal(void) /* flags are 0, set min limit */ GetSystemTime(st); + st[0].wDay = 25; st[1] = st[0]; st[1].wYear++; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5196
Wouldn't be the first time, 0cae0842b93ebc34344e2ea95a65c252e04aebbe. Thanks. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5196#note_63109
This merge request was approved by Nikolay Sivov. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5196
participants (3)
-
Nikolay Sivov (@nsivov) -
Noah Berner -
Noah Berner (@nberner)