From 8fdb1bec125a1b7d2d711a684a7da4cd2b23cb3b Mon Sep 17 00:00:00 2001 From: Austin Lund Date: Thu, 19 Aug 2010 15:50:04 +1000 Subject: [PATCH] comctl32/tests: DateTimePicker and MonthCalendar controls only support Gregorian calendar. --- dlls/comctl32/tests/datetime.c | 18 +++++++++++++----- dlls/comctl32/tests/monthcal.c | 13 ++++++++++++- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/dlls/comctl32/tests/datetime.c b/dlls/comctl32/tests/datetime.c index 83f8e031933..8b902ba62fe 100644 --- a/dlls/comctl32/tests/datetime.c +++ b/dlls/comctl32/tests/datetime.c @@ -659,7 +659,7 @@ static void test_dtm_set_and_get_system_time(void) static void test_wm_set_get_text(void) { static const CHAR a_str[] = "a"; - char buff[16], time[16]; + CHAR buff[16], time[16], caltype[3]; HWND hWnd; LRESULT ret; @@ -677,11 +677,19 @@ static void test_wm_set_get_text(void) ok(ret != 0, "Expected non-zero return value\n"); SetLastError(0xdeadbeef); - ret = GetDateFormat(LOCALE_USER_DEFAULT, 0, NULL, NULL, time, sizeof(time)); + ret = GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_ICALENDARTYPE, caltype, 3); 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); + skip("Must know local calendar type (%x)\n", GetLastError()); + else if (atoi(caltype) != CAL_GREGORIAN) + skip("DateTimePicker Control only supports Gregorian calendar (type: %s)\n", caltype); + else { + 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); } diff --git a/dlls/comctl32/tests/monthcal.c b/dlls/comctl32/tests/monthcal.c index f3db5220f86..52e16c3ea93 100644 --- a/dlls/comctl32/tests/monthcal.c +++ b/dlls/comctl32/tests/monthcal.c @@ -781,9 +781,20 @@ static void test_currdate(void) static void test_firstDay(void) { int res, fday, i, prev; - CHAR b[128]; + CHAR b[128], caltype[3]; LCID lcid = LOCALE_USER_DEFAULT; HWND hwnd; + LRESULT ret; + + SetLastError(0xdeadbeef); + ret = GetLocaleInfoA(lcid, LOCALE_ICALENDARTYPE, caltype, 3); + if (ret == 0) { + skip("Must know local calendar type (%x)\n", GetLastError()); + return; + } else if (atoi(caltype) != CAL_GREGORIAN) { + skip("MonthCalendar Control only supports Gregorian calendar (type: %s)\n", caltype); + return; + } hwnd = create_monthcal_control(0);