[PATCH] comctl32/tests: Do not perform comparison of dates if GetDateFormat fails.
Austin Lund
austin.lund at gmail.com
Tue Aug 17 21:27:38 CDT 2010
---
dlls/comctl32/tests/datetime.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/comctl32/tests/datetime.c b/dlls/comctl32/tests/datetime.c
index a97ab34..5d167bf 100644
--- a/dlls/comctl32/tests/datetime.c
+++ b/dlls/comctl32/tests/datetime.c
@@ -662,6 +662,7 @@ static void test_wm_set_get_text(void)
char buff[16], time[16];
HWND hWnd;
LRESULT ret;
+ int iret;
hWnd = create_datetime_control(0);
@@ -673,10 +674,15 @@ static void test_wm_set_get_text(void)
buff[0] = 0;
ret = SendMessage(hWnd, WM_GETTEXT, sizeof(buff), (LPARAM)buff);
- ok(strcmp(buff, a_str) != 0, "Expected text not to change, got %s\n", buff);
-
- GetDateFormat(LOCALE_USER_DEFAULT, 0, NULL, NULL, time, sizeof(time));
- ok(!strcmp(buff, time), "Expected %s, got %s\n", time, buff);
+ ok(strcmp(buff, a_str) != 0, "Expected text to change, got %s\n", buff);
+ ok(ret != 0, "Expected non-zero return value\n");
+
+ SetLastError(0xdeadbeef);
+ ret = GetDateFormat(LOCALE_USER_DEFAULT, 0, NULL, NULL, time, sizeof(time));
+ if (ret == 0)
+ skip("GetDateFormat failed, returned %d, error %d\n", ret, GetLastError());
+ else
+ ok(!strcmp(buff, time), "Expected %s, got %s\n", time, buff);
DestroyWindow(hWnd);
}
--
1.7.0.4
More information about the wine-patches
mailing list