Austin Lund : comctl32/tests: Do not perform comparison of dates if GetDateFormat fails.

Alexandre Julliard julliard at winehq.org
Wed Aug 18 12:09:55 CDT 2010


Module: wine
Branch: master
Commit: c3f9a4c362f91d04ef6ef4f8b9d5df69431c81b5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c3f9a4c362f91d04ef6ef4f8b9d5df69431c81b5

Author: Austin Lund <austin.lund at gmail.com>
Date:   Wed Aug 18 12:27:38 2010 +1000

comctl32/tests: Do not perform comparison of dates if GetDateFormat fails.

---

 dlls/comctl32/tests/datetime.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/dlls/comctl32/tests/datetime.c b/dlls/comctl32/tests/datetime.c
index a97ab34..83f8e03 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);
-
-    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 %ld, error %d\n", ret, GetLastError());
+    else
+        ok(!strcmp(buff, time), "Expected %s, got %s\n", time, buff);
 
     DestroyWindow(hWnd);
 }




More information about the wine-cvs mailing list