From c3f9a4c362f91d04ef6ef4f8b9d5df69431c81b5 Mon Sep 17 00:00:00 2001 From: Austin Lund Date: Wed, 18 Aug 2010 12:27:38 +1000 Subject: [PATCH] comctl32/tests: Do not perform comparison of dates if GetDateFormat fails. --- dlls/comctl32/tests/datetime.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dlls/comctl32/tests/datetime.c b/dlls/comctl32/tests/datetime.c index a97ab342dae..83f8e031933 100644 --- a/dlls/comctl32/tests/datetime.c +++ b/dlls/comctl32/tests/datetime.c @@ -673,10 +673,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); + ok(strcmp(buff, a_str) != 0, "Expected text to change, got %s\n", buff); + ok(ret != 0, "Expected non-zero return value\n"); - GetDateFormat(LOCALE_USER_DEFAULT, 0, NULL, NULL, time, sizeof(time)); - ok(!strcmp(buff, time), "Expected %s, got %s\n", time, buff); + SetLastError(0xdeadbeef); + ret = GetDateFormat(LOCALE_USER_DEFAULT, 0, NULL, NULL, time, sizeof(time)); + if (ret == 0) + skip("GetDateFormat failed, returned %ld, error %d\n", ret, GetLastError()); + else + ok(!strcmp(buff, time), "Expected %s, got %s\n", time, buff); DestroyWindow(hWnd); }