ReactOS  0.4.14-dev-337-gf981a68
monthcal.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "commctrl.h"
#include "wine/test.h"
#include "v6util.h"
#include <windows.h>
#include "msg.h"
Include dependency graph for monthcal.c:

Go to the source code of this file.

Macros

#define expect(expected, got)   ok(expected == got, "Expected %d, got %d\n", expected, got);
 
#define expect_hex(expected, got)   ok(expected == got, "Expected %x, got %x\n", expected, got);
 
#define expect_d(expected, got)   ok(abs((expected) - (got)) <= 2, "Expected %d, got %d\n", expected, got);
 
#define NUM_MSG_SEQUENCES   2
 
#define PARENT_SEQ_INDEX   0
 
#define MONTHCAL_SEQ_INDEX   1
 
#define SEL_NOTIFY_TEST_ID   100
 
#define X(f)   p##f = (void*)GetProcAddress(hComCtl32, #f);
 

Functions

static BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX *)
 
static void test_monthcal (void)
 
static LRESULT WINAPI parent_wnd_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static BOOL register_parent_wnd_class (void)
 
static HWND create_parent_window (void)
 
static LRESULT WINAPI monthcal_subclass_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static HWND create_monthcal_control (DWORD style)
 
static void test_color (void)
 
static void test_currdate (void)
 
static void test_firstDay (void)
 
static void test_unicode (void)
 
static void test_hittest (void)
 
static void test_todaylink (void)
 
static void test_today (void)
 
static void test_scroll (void)
 
static void test_monthrange (void)
 
static void test_maxselday (void)
 
static void test_size (void)
 
static void test_create (void)
 
static void test_destroy (void)
 
static void test_selrange (void)
 
static void test_killfocus (void)
 
static void test_hittest_v6 (void)
 
static void test_get_set_border (void)
 
static void test_MCM_SIZERECTTOMIN (void)
 
static void test_MCM_GETCALENDARCOUNT (void)
 
static void test_daystate (void)
 
static void test_sel_notify (void)
 
static void init_functions (void)
 
 START_TEST (monthcal)
 

Variables

static struct msg_sequencesequences [NUM_MSG_SEQUENCES]
 
static HWND parent_wnd
 
static const struct message create_parent_window_seq []
 
static const struct message create_monthcal_control_seq []
 
static const struct message create_monthcal_multi_sel_style_seq []
 
static const struct message monthcal_curr_date_seq []
 
static const struct message monthcal_first_day_seq []
 
static const struct message monthcal_unicode_seq []
 
static const struct message monthcal_hit_test_seq []
 
static const struct message monthcal_todaylink_seq []
 
static const struct message monthcal_today_seq []
 
static const struct message monthcal_scroll_seq []
 
static const struct message monthcal_monthrange_seq []
 
static const struct message monthcal_max_sel_day_seq []
 
static const struct message destroy_monthcal_parent_msgs_seq []
 
static const struct message destroy_monthcal_child_msgs_seq []
 
static const struct message destroy_monthcal_multi_sel_style_seq []
 

Macro Definition Documentation

◆ expect

#define expect (   expected,
  got 
)    ok(expected == got, "Expected %d, got %d\n", expected, got);

Definition at line 35 of file monthcal.c.

◆ expect_d

#define expect_d (   expected,
  got 
)    ok(abs((expected) - (got)) <= 2, "Expected %d, got %d\n", expected, got);

Definition at line 37 of file monthcal.c.

◆ expect_hex

#define expect_hex (   expected,
  got 
)    ok(expected == got, "Expected %x, got %x\n", expected, got);

Definition at line 36 of file monthcal.c.

◆ MONTHCAL_SEQ_INDEX

#define MONTHCAL_SEQ_INDEX   1

Definition at line 41 of file monthcal.c.

◆ NUM_MSG_SEQUENCES

#define NUM_MSG_SEQUENCES   2

Definition at line 39 of file monthcal.c.

◆ PARENT_SEQ_INDEX

#define PARENT_SEQ_INDEX   0

Definition at line 40 of file monthcal.c.

◆ SEL_NOTIFY_TEST_ID

#define SEL_NOTIFY_TEST_ID   100

Definition at line 43 of file monthcal.c.

◆ X

#define X (   f)    p##f = (void*)GetProcAddress(hComCtl32, #f);

Function Documentation

◆ BOOL()

static BOOL ( WINAPI pInitCommonControlsEx) const
static

Referenced by MonthCalWndProc().

◆ create_monthcal_control()

static HWND create_monthcal_control ( DWORD  style)
static

Definition at line 649 of file monthcal.c.

650 {
651  WNDPROC oldproc;
652  RECT rect;
653  HWND hwnd;
654  BOOL ret;
655 
657  0, 0, 300, 400, parent_wnd, NULL, GetModuleHandleA(NULL), NULL);
658  ok(hwnd != NULL, "failed to create monthcal wnd\n");
659  if (!hwnd) return NULL;
660 
664 
666 
667  /* make sure calendar grid is 2x1 */
669  ok(ret, "got %d\n", ret);
670 
671  ret = SetWindowPos(hwnd, NULL, 0, 0, rect.right * 5 / 2, rect.bottom * 3 / 2, SWP_NOMOVE);
672  ok(ret, "got %d\n", ret);
673 
674  return hwnd;
675 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define MCM_GETMINREQRECT
Definition: commctrl.h:4196
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
UINT_PTR WPARAM
Definition: windef.h:207
#define WS_CHILD
Definition: pedump.c:617
#define MONTHCAL_CLASSA
Definition: commctrl.h:4172
& rect
Definition: startmenu.cpp:1413
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GWLP_USERDATA
Definition: treelist.c:63
smooth NULL
Definition: ftsmooth.c:416
#define SYSTEM_FONT
Definition: wingdi.h:910
LONG_PTR LPARAM
Definition: windef.h:208
static LRESULT WINAPI monthcal_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: monthcal.c:620
int ret
#define SetWindowLongPtrA
Definition: winuser.h:5246
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
#define GWLP_WNDPROC
Definition: treelist.c:66
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2880
#define WS_BORDER
Definition: pedump.c:625
#define ok(value,...)
Definition: atltest.h:57
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WM_SETFONT
Definition: winuser.h:1632
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define SWP_NOMOVE
Definition: winuser.h:1229
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620
static HWND parent_wnd
Definition: monthcal.c:49

Referenced by test_color(), test_create(), test_currdate(), test_daystate(), test_destroy(), test_firstDay(), test_get_set_border(), test_hittest(), test_hittest_v6(), test_killfocus(), test_maxselday(), test_MCM_GETCALENDARCOUNT(), test_MCM_SIZERECTTOMIN(), test_monthrange(), test_scroll(), test_sel_notify(), test_selrange(), test_size(), test_today(), test_todaylink(), and test_unicode().

◆ create_parent_window()

static HWND create_parent_window ( void  )
static

Definition at line 599 of file monthcal.c.

600 {
601  HWND hwnd;
602 
603  /* flush message sequences, so we can check the new sequence by the end of function */
605 
607  return NULL;
608 
609  hwnd = CreateWindowExA(0, "Month-Cal test parent class", "Month-Cal test parent window",
611  0, 0, 500, 500, GetDesktopWindow(), NULL, GetModuleHandleA(NULL), NULL);
612  ok(hwnd != NULL, "failed to create parent wnd\n");
613 
614  /* check for message sequences */
616 
617  return hwnd;
618 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define NUM_MSG_SEQUENCES
Definition: monthcal.c:39
#define PARENT_SEQ_INDEX
Definition: monthcal.c:40
static const struct message create_parent_window_seq[]
Definition: monthcal.c:51
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: monthcal.c:47
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:652
#define WS_MAXIMIZEBOX
Definition: pedump.c:632
#define WS_CAPTION
Definition: pedump.c:624
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
#define WS_MINIMIZEBOX
Definition: pedump.c:631
#define ok(value,...)
Definition: atltest.h:57
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
static BOOL register_parent_wnd_class(void)
Definition: monthcal.c:582
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_SYSMENU
Definition: pedump.c:629

Referenced by START_TEST().

◆ init_functions()

static void init_functions ( void  )
static

Definition at line 2041 of file monthcal.c.

2042 {
2043  HMODULE hComCtl32 = LoadLibraryA("comctl32.dll");
2044 
2045 #define X(f) p##f = (void*)GetProcAddress(hComCtl32, #f);
2047 #undef X
2048 }
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
#define X(f)
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893

Referenced by START_TEST().

◆ monthcal_subclass_proc()

static LRESULT WINAPI monthcal_subclass_proc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 620 of file monthcal.c.

621 {
623  static LONG defwndproc_counter = 0;
624  struct message msg = { 0 };
625  LRESULT ret;
626 
627  msg.message = message;
628  msg.flags = sent|wparam|lparam;
629  if (defwndproc_counter) msg.flags |= defwinproc;
630  msg.wParam = wParam;
631  msg.lParam = lParam;
633 
634  /* some debug output for style changing */
635  if ((message == WM_STYLECHANGING ||
636  message == WM_STYLECHANGED) && lParam)
637  {
639  trace("\told style: 0x%08x, new style: 0x%08x\n", style->styleOld, style->styleNew);
640  }
641 
642  defwndproc_counter++;
643  ret = CallWindowProcA(oldproc, hwnd, message, wParam, lParam);
644  defwndproc_counter--;
645 
646  return ret;
647 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Definition: tftpd.h:59
#define MONTHCAL_SEQ_INDEX
Definition: monthcal.c:41
Definition: msg.h:39
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glext.h:5579
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: monthcal.c:47
long LONG
Definition: pedump.c:60
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define GWLP_USERDATA
Definition: treelist.c:63
#define GetWindowLongPtrA
Definition: winuser.h:4729
#define trace
Definition: atltest.h:70
int ret
Definition: msg.h:34
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2880
#define add_message(msg)
Definition: msg.c:2142
#define msg(x)
Definition: auth_time.c:54
LONG_PTR LRESULT
Definition: windef.h:209
Arabic default style
Definition: afstyles.h:93
LPARAM lParam
Definition: combotst.c:139
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by create_monthcal_control().

◆ parent_wnd_proc()

static LRESULT WINAPI parent_wnd_proc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 496 of file monthcal.c.

497 {
498  static LONG defwndproc_counter = 0;
499  LRESULT ret;
500  struct message msg;
501 
502  /* log system messages, except for painting */
503  if (message < WM_USER &&
504  message != WM_PAINT &&
505  message != WM_ERASEBKGND &&
506  message != WM_NCPAINT &&
507  message != WM_NCHITTEST &&
508  message != WM_GETTEXT &&
509  message != WM_GETICON &&
511  {
512  msg.message = message;
513  msg.flags = sent|wparam|lparam;
514  if (defwndproc_counter) msg.flags |= defwinproc;
515  msg.wParam = wParam;
516  msg.lParam = lParam;
518  }
519 
520  if (message == WM_NOTIFY)
521  {
522  NMHDR *hdr = (NMHDR*)lParam;
523  switch (hdr->code)
524  {
525  case MCN_GETDAYSTATE:
526  {
527  NMDAYSTATE *nmstate = (NMDAYSTATE*)lParam;
528  static MONTHDAYSTATE months[14] = { 0 };
529 
530  ok(nmstate->cDayState > 0, "got %d\n", nmstate->cDayState);
531  ok(nmstate->cDayState <= 14, "got %d\n", nmstate->cDayState);
532  ok(nmstate->prgDayState != NULL, "got %p\n", nmstate->prgDayState);
533 
534  nmstate->prgDayState = months;
535 
536  return TRUE;
537  }
538  case MCN_SELECT:
539  case MCN_SELCHANGE:
540  {
541  NMSELCHANGE *nmchg = (NMSELCHANGE*)lParam;
542  SYSTEMTIME st[2];
544 
546  break;
547  SendMessageA(nmchg->nmhdr.hwndFrom, is_multisel ? MCM_GETSELRANGE : MCM_GETCURSEL,
548  0, (LPARAM)st);
549 
550  expect(st[0].wYear, nmchg->stSelStart.wYear);
551  expect(st[0].wMonth, nmchg->stSelStart.wMonth);
552  expect(0, nmchg->stSelStart.wDayOfWeek);
553  expect(st[0].wDay, nmchg->stSelStart.wDay);
554 
555  if(is_multisel)
556  {
557  expect(st[1].wYear, nmchg->stSelEnd.wYear);
558  expect(st[1].wMonth, nmchg->stSelEnd.wMonth);
559  expect(0, nmchg->stSelEnd.wDayOfWeek);
560  expect(st[1].wDay, nmchg->stSelEnd.wDay);
561  }
562  else
563  ok(!(nmchg->stSelEnd.wYear | nmchg->stSelEnd.wMonth |
564  nmchg->stSelEnd.wDayOfWeek | nmchg->stSelEnd.wDay |
565  nmchg->stSelEnd.wHour | nmchg->stSelEnd.wMinute |
566  nmchg->stSelEnd.wSecond | nmchg->stSelEnd.wMilliseconds),
567  "Non-zero member in stSelEnd\n");
568  return TRUE;
569  }
570  default:
571  break;
572  }
573  }
574 
575  defwndproc_counter++;
577  defwndproc_counter--;
578 
579  return ret;
580 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define MCN_SELECT
Definition: commctrl.h:4301
Definition: tftpd.h:59
#define TRUE
Definition: types.h:120
char hdr[14]
Definition: iptest.cpp:33
WORD wMonth
Definition: winbase.h:878
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
WORD wDayOfWeek
Definition: winbase.h:879
#define WM_GETTEXT
Definition: winuser.h:1600
Definition: msg.h:39
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glext.h:5579
#define expect(expected, got)
Definition: monthcal.c:35
#define WM_NCHITTEST
Definition: winuser.h:1668
#define MCN_SELCHANGE
Definition: commctrl.h:4287
LPMONTHDAYSTATE prgDayState
Definition: commctrl.h:4294
WPARAM wParam
Definition: combotst.c:138
#define PARENT_SEQ_INDEX
Definition: monthcal.c:40
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: monthcal.c:47
#define WM_NCPAINT
Definition: winuser.h:1669
SYSTEMTIME stSelEnd
Definition: commctrl.h:4284
WORD wYear
Definition: winbase.h:877
#define MCM_GETCURSEL
Definition: commctrl.h:4180
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
WORD wMinute
Definition: winbase.h:882
smooth NULL
Definition: ftsmooth.c:416
SYSTEMTIME stSelStart
Definition: commctrl.h:4283
LONG_PTR LPARAM
Definition: windef.h:208
#define GetWindowLongPtrA
Definition: winuser.h:4729
#define SEL_NOTIFY_TEST_ID
Definition: monthcal.c:43
#define MCS_MULTISELECT
Definition: commctrl.h:4304
WORD wSecond
Definition: winbase.h:883
#define WM_PAINT
Definition: winuser.h:1602
WORD wMilliseconds
Definition: winbase.h:884
int ret
Definition: msg.h:34
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND hwndFrom
Definition: winuser.h:3131
#define WM_USER
Definition: winuser.h:1877
#define GWL_STYLE
Definition: winuser.h:846
WORD wDay
Definition: winbase.h:880
#define add_message(msg)
Definition: msg.c:2142
#define ok(value,...)
Definition: atltest.h:57
WORD wHour
Definition: winbase.h:881
#define WM_DEVICECHANGE
Definition: winuser.h:1793
#define MCN_GETDAYSTATE
Definition: commctrl.h:4297
#define msg(x)
Definition: auth_time.c:54
#define MCM_GETSELRANGE
Definition: commctrl.h:4188
#define WM_ERASEBKGND
Definition: winuser.h:1607
LONG_PTR LRESULT
Definition: windef.h:209
DWORD MONTHDAYSTATE
Definition: commctrl.h:4176
LPARAM lParam
Definition: combotst.c:139
#define GWLP_ID
Definition: winuser.h:854
#define WM_NOTIFY
Definition: richedit.h:61
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by register_parent_wnd_class().

◆ register_parent_wnd_class()

static BOOL register_parent_wnd_class ( void  )
static

Definition at line 582 of file monthcal.c.

583 {
584  WNDCLASSA cls;
585 
586  cls.style = 0;
588  cls.cbClsExtra = 0;
589  cls.cbWndExtra = 0;
591  cls.hIcon = 0;
592  cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
594  cls.lpszMenuName = NULL;
595  cls.lpszClassName = "Month-Cal test parent class";
596  return RegisterClassA(&cls);
597 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
int cbClsExtra
Definition: winuser.h:3139
LPCSTR lpszMenuName
Definition: winuser.h:3145
#define WHITE_BRUSH
Definition: wingdi.h:901
HBRUSH hbrBackground
Definition: winuser.h:3144
int cbWndExtra
Definition: winuser.h:3140
HCURSOR hCursor
Definition: winuser.h:3143
smooth NULL
Definition: ftsmooth.c:416
const char * LPCSTR
Definition: xmlstorage.h:183
static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: monthcal.c:496
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
LPCSTR lpszClassName
Definition: winuser.h:3146
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
UINT style
Definition: winuser.h:3137
HINSTANCE hInstance
Definition: winuser.h:3141
WNDPROC lpfnWndProc
Definition: winuser.h:3138
#define IDC_ARROW
Definition: winuser.h:682
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
HICON hIcon
Definition: winuser.h:3142

Referenced by create_parent_window().

◆ START_TEST()

START_TEST ( monthcal  )

Definition at line 2050 of file monthcal.c.

2051 {
2052  INITCOMMONCONTROLSEX iccex;
2053  ULONG_PTR ctx_cookie;
2054  HANDLE hCtx;
2055 
2056  init_functions();
2057 
2058  iccex.dwSize = sizeof(iccex);
2059  iccex.dwICC = ICC_DATE_CLASSES;
2060  pInitCommonControlsEx(&iccex);
2061 
2062  test_monthcal();
2063 
2065 
2067 
2068  test_create();
2069  test_destroy();
2070  test_color();
2071  test_currdate();
2072  test_firstDay();
2073  test_unicode();
2074  test_today();
2075  test_scroll();
2076  test_monthrange();
2077  test_hittest();
2078  test_todaylink();
2079  test_size();
2080  test_maxselday();
2081  test_selrange();
2082  test_killfocus();
2083  test_daystate();
2084  test_sel_notify();
2085 
2086  if (!load_v6_module(&ctx_cookie, &hCtx))
2087  {
2089  return;
2090  }
2091 
2092  test_hittest_v6();
2096 
2097  unload_v6_module(ctx_cookie, hCtx);
2098 
2100 }
static void test_color(void)
Definition: monthcal.c:680
#define NUM_MSG_SEQUENCES
Definition: monthcal.c:39
static void test_destroy(void)
Definition: monthcal.c:1612
static void test_todaylink(void)
Definition: monthcal.c:1249
static void test_create(void)
Definition: monthcal.c:1595
static void unload_v6_module(ULONG_PTR cookie, HANDLE hCtx)
Definition: v6util.h:63
static void test_hittest_v6(void)
Definition: monthcal.c:1757
static void test_MCM_GETCALENDARCOUNT(void)
Definition: monthcal.c:1920
BOOL WINAPI DestroyWindow(_In_ HWND)
uint32_t ULONG_PTR
Definition: typedefs.h:63
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: monthcal.c:47
static void test_hittest(void)
Definition: monthcal.c:1003
static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx)
Definition: v6util.h:71
static void test_scroll(void)
Definition: monthcal.c:1363
static void init_msg_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:391
static void test_monthrange(void)
Definition: monthcal.c:1404
static void test_today(void)
Definition: monthcal.c:1306
static void test_selrange(void)
Definition: monthcal.c:1629
#define ICC_DATE_CLASSES
Definition: commctrl.h:67
static void test_daystate(void)
Definition: monthcal.c:1940
static void test_MCM_SIZERECTTOMIN(void)
Definition: monthcal.c:1877
static void test_get_set_border(void)
Definition: monthcal.c:1852
static void test_monthcal(void)
Definition: monthcal.c:261
static void test_maxselday(void)
Definition: monthcal.c:1493
static void test_size(void)
Definition: monthcal.c:1559
static void test_firstDay(void)
Definition: monthcal.c:903
static void init_functions(void)
Definition: monthcal.c:2041
static void test_unicode(void)
Definition: monthcal.c:960
static void test_sel_notify(void)
Definition: monthcal.c:1998
static HWND parent_wnd
Definition: monthcal.c:49
static HWND create_parent_window(void)
Definition: monthcal.c:599
static void test_killfocus(void)
Definition: monthcal.c:1735
static void test_currdate(void)
Definition: monthcal.c:756

◆ test_color()

static void test_color ( void  )
static

Definition at line 680 of file monthcal.c.

681 {
682  COLORREF color, prev;
683  HWND hwnd;
684 
686 
687  /* invalid color index */
689  expect(~0u, color);
690  prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_TRAILINGTEXT + 1, RGB(255,255,255));
691  expect(~0u, prev);
692 
695  expect(color, prev);
697  expect(RGB(0,0,0), color);
698  prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_BACKGROUND, RGB(255,255,255));
699  expect(color, prev);
701  expect(RGB(255,255,255), color);
702 
704  prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_MONTHBK, RGB(0,0,0));
705  expect(color, prev);
707  expect(RGB(0,0,0), color);
708  prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_MONTHBK, RGB(255,255,255));
709  expect(color, prev);
711  expect(RGB(255,255,255), color);
712 
714  prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_TEXT, RGB(0,0,0));
715  expect(color, prev);
717  expect(RGB(0,0,0), color);
718  prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_TEXT, RGB(255,255,255));
719  expect(color, prev);
721  expect(RGB(255,255,255), color);
722 
724  prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_TITLEBK, RGB(0,0,0));
725  expect(color, prev);
727  expect(RGB(0,0,0), color);
728  prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_TITLEBK, RGB(255,255,255));
729  expect(color, prev);
731  expect(RGB(255,255,255), color);
732 
734  prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_TITLETEXT, RGB(0,0,0));
735  expect(color, prev);
737  expect(RGB(0,0,0), color);
738  prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_TITLETEXT, RGB(255,255,255));
739  expect(color, prev);
741  expect(RGB(255,255,255), color);
742 
745  expect(color, prev);
747  expect(RGB(0,0,0), color);
748  prev = SendMessageA(hwnd, MCM_SETCOLOR, MCSC_TRAILINGTEXT, RGB(255,255,255));
749  expect(color, prev);
751  expect(RGB(255,255,255), color);
752 
754 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
#define MCSC_MONTHBK
Definition: commctrl.h:4207
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define MCSC_TEXT
Definition: commctrl.h:4204
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define expect(expected, got)
Definition: monthcal.c:35
BOOL WINAPI DestroyWindow(_In_ HWND)
#define MCSC_TITLETEXT
Definition: commctrl.h:4206
GLuint color
Definition: glext.h:6243
#define MCM_SETCOLOR
Definition: commctrl.h:4198
DWORD COLORREF
Definition: windef.h:285
#define RGB(r, g, b)
Definition: wingdi.h:2935
static HWND create_monthcal_control(DWORD style)
Definition: monthcal.c:649
#define MCSC_BACKGROUND
Definition: commctrl.h:4203
#define MCSC_TITLEBK
Definition: commctrl.h:4205
#define MCSC_TRAILINGTEXT
Definition: commctrl.h:4208
#define MCM_GETCOLOR
Definition: commctrl.h:4200

Referenced by START_TEST().

◆ test_create()

static void test_create ( void  )
static

Definition at line 1595 of file monthcal.c.

1596 {
1597  HWND hwnd;
1598 
1600 
1603 
1605 
1608  ok_sequence(sequences, PARENT_SEQ_INDEX, create_monthcal_multi_sel_style_seq, "create monthcal (multi sel style)", TRUE);
1610 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define NUM_MSG_SEQUENCES
Definition: monthcal.c:39
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PARENT_SEQ_INDEX
Definition: monthcal.c:40
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: monthcal.c:47
static const struct message create_monthcal_multi_sel_style_seq[]
Definition: monthcal.c:83
static const struct message create_monthcal_control_seq[]
Definition: monthcal.c:75
#define MCS_MULTISELECT
Definition: commctrl.h:4304
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
static HWND create_monthcal_control(DWORD style)
Definition: monthcal.c:649
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97

Referenced by START_TEST().

◆ test_currdate()

static void test_currdate ( void  )
static

Definition at line 756 of file monthcal.c.

757 {
758  SYSTEMTIME st_original, st_new, st_test;
759  int res;
760  HWND hwnd;
761 
763 
765 
766  /* Setter and Getters for current date selected */
767  st_original.wYear = 2000;
768  st_original.wMonth = 11;
769  st_original.wDay = 28;
770  st_original.wHour = 11;
771  st_original.wMinute = 59;
772  st_original.wSecond = 30;
773  st_original.wMilliseconds = 0;
774  st_original.wDayOfWeek = 0;
775 
776  st_new = st_test = st_original;
777 
778  /* Should not validate the time */
779  res = SendMessageA(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_test);
780  expect(1,res);
781 
782  /* Overflow matters, check for wDay */
783  st_test.wDay += 4;
784  res = SendMessageA(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_test);
785  expect(0,res);
786 
787  /* correct wDay before checking for wMonth */
788  st_test.wDay -= 4;
789  expect(st_original.wDay, st_test.wDay);
790 
791  /* Overflow matters, check for wMonth */
792  st_test.wMonth += 4;
793  res = SendMessageA(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_test);
794  expect(0,res);
795 
796  /* checking if gets the information right, modify st_new */
797  st_new.wYear += 4;
798  st_new.wMonth += 4;
799  st_new.wDay += 4;
800  st_new.wHour += 4;
801  st_new.wMinute += 4;
802  st_new.wSecond += 4;
803 
804  res = SendMessageA(hwnd, MCM_GETCURSEL, 0, (LPARAM)&st_new);
805  expect(1, res);
806 
807  /* st_new change to st_origin, above settings with overflow */
808  /* should not change the current settings */
809  expect(st_original.wYear, st_new.wYear);
810  expect(st_original.wMonth, st_new.wMonth);
811  expect(st_original.wDay, st_new.wDay);
812  ok(st_original.wHour == st_new.wHour ||
813  broken(0 == st_new.wHour), /* comctl32 <= 4.70 */
814  "Expected %d, got %d\n", st_original.wHour, st_new.wHour);
815  ok(st_original.wMinute == st_new.wMinute ||
816  broken(0 == st_new.wMinute), /* comctl32 <= 4.70 */
817  "Expected %d, got %d\n", st_original.wMinute, st_new.wMinute);
818  ok(st_original.wSecond == st_new.wSecond ||
819  broken(0 == st_new.wSecond), /* comctl32 <= 4.70 */
820  "Expected %d, got %d\n", st_original.wSecond, st_new.wSecond);
821 
822  /* lparam cannot be NULL */
824  expect(0, res);
825 
827 
828  /* December, 31, 9999 is the maximum allowed date */
829  memset(&st_new, 0, sizeof(st_new));
830  st_new.wYear = 9999;
831  st_new.wMonth = 12;
832  st_new.wDay = 31;
833  res = SendMessageA(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_new);
834  expect(1, res);
835  memset(&st_test, 0, sizeof(st_test));
836  res = SendMessageA(hwnd, MCM_GETCURSEL, 0, (LPARAM)&st_test);
837  expect(1, res);
838  expect(st_new.wYear, st_test.wYear);
839  expect(st_new.wMonth, st_test.wMonth);
840  expect(st_new.wDay, st_test.wDay);
841  expect(st_new.wHour, st_test.wHour);
842  expect(st_new.wMinute, st_test.wMinute);
843  expect(st_new.wSecond, st_test.wSecond);
844  /* try one day later */
845  st_original = st_new;
846  st_new.wYear = 10000;
847  st_new.wMonth = 1;
848  st_new.wDay = 1;
849  res = SendMessageA(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_new);
850  ok(0 == res ||
851  broken(1 == res), /* comctl32 <= 4.72 */
852  "Expected 0, got %d\n", res);
853  if (0 == res)
854  {
855  memset(&st_test, 0, sizeof(st_test));
856  res = SendMessageA(hwnd, MCM_GETCURSEL, 0, (LPARAM)&st_test);
857  expect(1, res);
858  expect(st_original.wYear, st_test.wYear);
859  expect(st_original.wMonth, st_test.wMonth);
860  expect(st_original.wDay, st_test.wDay);
861  expect(st_original.wHour, st_test.wHour);
862  expect(st_original.wMinute, st_test.wMinute);
863  expect(st_original.wSecond, st_test.wSecond);
864  }
865 
866  /* setting selection equal to current reports success even if out range */
867  memset(&st_new, 0, sizeof(st_new));
868  st_new.wYear = 2009;
869  st_new.wDay = 5;
870  st_new.wMonth = 10;
871  res = SendMessageA(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_new);
872  expect(1, res);
873  memset(&st_test, 0, sizeof(st_test));
874  st_test.wYear = 2009;
875  st_test.wDay = 6;
876  st_test.wMonth = 10;
878  expect(1, res);
879  /* set to current again */
880  res = SendMessageA(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_new);
881  expect(1, res);
882 
883  /* set with invalid day of week */
884  memset(&st_test, 0, sizeof(st_test));
885  st_test.wYear = 2009;
886  st_test.wDay = 7;
887  st_test.wMonth = 10;
888  st_test.wDayOfWeek = 100;
889  res = SendMessageA(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_test);
890  expect(1, res);
891 
892  memset(&st_test, 0, sizeof(st_test));
893  res = SendMessageA(hwnd, MCM_GETCURSEL, 0, (LPARAM)&st_test);
894  expect(1, res);
895  expect(2009, st_test.wYear);
896  expect(7, st_test.wDay);
897  expect(10, st_test.wMonth);
898  expect(3, st_test.wDayOfWeek);
899 
901 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define NUM_MSG_SEQUENCES
Definition: monthcal.c:39
WORD wMonth
Definition: winbase.h:878
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
WORD wDayOfWeek
Definition: winbase.h:879
#define MONTHCAL_SEQ_INDEX
Definition: monthcal.c:41
#define expect(expected, got)
Definition: monthcal.c:35
#define MCM_SETRANGE
Definition: commctrl.h:4260
BOOL WINAPI DestroyWindow(_In_ HWND)
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: monthcal.c:47
WORD wYear
Definition: winbase.h:877
#define MCM_GETCURSEL
Definition: commctrl.h:4180
WORD wMinute
Definition: winbase.h:882
LONG_PTR LPARAM
Definition: windef.h:208
#define MCM_SETCURSEL
Definition: commctrl.h:4182
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
static HWND create_monthcal_control(DWORD style)
Definition: monthcal.c:649
WORD wSecond
Definition: winbase.h:883
WORD wMilliseconds
Definition: winbase.h:884
#define GDTR_MIN
Definition: commctrl.h:4452
#define broken(x)
Definition: _sntprintf.h:21
WORD wDay
Definition: winbase.h:880
#define ok(value,...)
Definition: atltest.h:57
WORD wHour
Definition: winbase.h:881
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
GLuint res
Definition: glext.h:9613
#define memset(x, y, z)
Definition: compat.h:39
static const struct message monthcal_curr_date_seq[]
Definition: monthcal.c:91

Referenced by START_TEST().

◆ test_daystate()

static void test_daystate ( void  )
static

Definition at line 1940 of file monthcal.c.

1941 {
1942  MONTHDAYSTATE state[4];
1943  DWORD ret, style;
1944  HWND hwnd;
1945  RECT r;
1946 
1947  /* without MCS_DAYSTATE */
1949 
1951  expect(TRUE, ret);
1952 
1953  /* resize control to display two Calendars */
1954  MoveWindow(hwnd, 0, 0, r.right, (5/2)*r.bottom, FALSE);
1955 
1957  expect(4, ret);
1958 
1960  expect(0, ret);
1961 
1963  expect(0, ret);
1964 
1966  expect(0, ret);
1967 
1968  /* try to switch on */
1971  ok((style & MCS_DAYSTATE) == 0, "got 0x%08x\n", style);
1972 
1974 
1975  /* with MCS_DAYSTATE */
1977 
1979  expect(4, ret);
1980 
1982  expect(1, ret);
1983 
1985  expect(0, ret);
1986 
1988  expect(0, ret);
1989 
1990  /* try to switch off */
1993  ok((style & MCS_DAYSTATE) == MCS_DAYSTATE, "got 0x%08x\n", style);
1994 
1996 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define MCM_GETMINREQRECT
Definition: commctrl.h:4196
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define expect(expected, got)
Definition: monthcal.c:35
BOOL WINAPI DestroyWindow(_In_ HWND)
#define MCS_DAYSTATE
Definition: commctrl.h:4303
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
LONG_PTR LPARAM
Definition: windef.h:208
#define GMR_DAYSTATE
Definition: commctrl.h:4312
#define MCM_SETDAYSTATE
Definition: commctrl.h:4194
unsigned long DWORD
Definition: ntddk_ex.h:95
static HWND create_monthcal_control(DWORD style)
Definition: monthcal.c:649
int ret
static int state
Definition: maze.c:121
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
#define GWL_STYLE
Definition: winuser.h:846
#define ok(value,...)
Definition: atltest.h:57
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
#define MCM_GETMONTHRANGE
Definition: commctrl.h:4192
Arabic default style
Definition: afstyles.h:93
DWORD MONTHDAYSTATE
Definition: commctrl.h:4176

Referenced by START_TEST().

◆ test_destroy()

static void test_destroy ( void  )
static

Definition at line 1612 of file monthcal.c.

1613 {
1614  HWND hwnd;
1615 
1619  ok_sequence(sequences, PARENT_SEQ_INDEX, destroy_monthcal_parent_msgs_seq, "Destroy monthcal (parent msg)", FALSE);
1621 
1622  /* MCS_MULTISELECT */
1626  ok_sequence(sequences, MONTHCAL_SEQ_INDEX, destroy_monthcal_multi_sel_style_seq, "Destroy monthcal (multi sel style)", FALSE);
1627 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define NUM_MSG_SEQUENCES
Definition: monthcal.c:39
#define MONTHCAL_SEQ_INDEX
Definition: monthcal.c:41
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PARENT_SEQ_INDEX
Definition: monthcal.c:40
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: monthcal.c:47
static const struct message destroy_monthcal_multi_sel_style_seq[]
Definition: monthcal.c:251
#define MCS_MULTISELECT
Definition: commctrl.h:4304
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
static const struct message destroy_monthcal_parent_msgs_seq[]
Definition: monthcal.c:235
static HWND create_monthcal_control(DWORD style)
Definition: monthcal.c:649
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
static const struct message destroy_monthcal_child_msgs_seq[]
Definition: monthcal.c:241

Referenced by START_TEST().

◆ test_firstDay()

static void test_firstDay ( void  )
static

Definition at line 903 of file monthcal.c.

904 {
905  int res, fday, i, prev;
906  CHAR b[128], caltype[3];
907  LCID lcid = LOCALE_USER_DEFAULT;
908  HWND hwnd;
909  LRESULT ret;
910 
911  SetLastError(0xdeadbeef);
912  ret = GetLocaleInfoA(lcid, LOCALE_ICALENDARTYPE, caltype, 3);
913  if (ret == 0) {
914  skip("Must know local calendar type (%x)\n", GetLastError());
915  return;
916  } else if (atoi(caltype) != CAL_GREGORIAN) {
917  skip("MonthCalendar Control only supports Gregorian calendar (type: %s)\n", caltype);
918  return;
919  }
920 
922 
924 
925  /* Setter and Getters for first day of week */
926  /* check for locale first day */
927  if(GetLocaleInfoA(lcid, LOCALE_IFIRSTDAYOFWEEK, b, 128)){
928  fday = atoi(b);
930  expect(fday, res);
931  prev = fday;
932 
933  /* checking for the values that actually will be stored as */
934  /* current first day when we set a new value */
935  for (i = -5; i < 12; i++){
937  expect(prev, res);
939  prev = res;
940 
941  if (i == -1){
942  expect(MAKELONG(fday, FALSE), res);
943  }else if (i >= 7){
944  /* out of range sets max first day of week, locale is ignored */
945  expect(MAKELONG(6, TRUE), res);
946  }else{
947  expect(MAKELONG(i, TRUE), res);
948  }
949  }
950 
952 
953  }else{
954  skip("Cannot retrieve first day of the week\n");
955  }
956 
958 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define NUM_MSG_SEQUENCES
Definition: monthcal.c:39
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
INT WINAPI GetLocaleInfoA(LCID lcid, LCTYPE lctype, LPSTR buffer, INT len)
Definition: lang.c:1018
#define LOCALE_USER_DEFAULT
static const struct message monthcal_first_day_seq[]
Definition: monthcal.c:101
char CHAR
Definition: xmlstorage.h:175
#define MONTHCAL_SEQ_INDEX
Definition: monthcal.c:41
#define LOCALE_ICALENDARTYPE
Definition: winnls.h:73
#define expect(expected, got)
Definition: monthcal.c:35
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
DWORD LCID
Definition: nls.h:13
BOOL WINAPI DestroyWindow(_In_ HWND)
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: monthcal.c:47
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define MAKELONG(a, b)
Definition: typedefs.h:248
#define MCM_SETFIRSTDAYOFWEEK
Definition: commctrl.h:4254
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define CAL_GREGORIAN
Definition: winnls.h:440
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
#define SetLastError(x)
Definition: compat.h:417
static HWND create_monthcal_control(DWORD style)
Definition: monthcal.c:649
#define MCM_GETFIRSTDAYOFWEEK
Definition: commctrl.h:4256
int ret
#define LOCALE_IFIRSTDAYOFWEEK
Definition: winnls.h:75
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
#define skip(...)
Definition: atltest.h:64
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
GLuint res
Definition: glext.h:9613
LONG_PTR LRESULT
Definition: windef.h:209

Referenced by START_TEST().

◆ test_get_set_border()

static void test_get_set_border ( void  )
static

Definition at line 1852 of file monthcal.c.

1853 {
1854  HWND hwnd;
1855  DWORD ret;
1856 
1858 
1859  /* a non-default value */
1861  expect(0, ret);
1862 
1864 
1865  if (ret != 10)
1866  {
1867  skip("MCM_GET/SETCALENDARBORDER not supported\n");
1869  return;
1870  }
1871 
1872  expect(10, ret);
1873 
1875 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define MCM_GETCALENDARBORDER
Definition: commctrl.h:4279
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define expect(expected, got)
Definition: monthcal.c:35
BOOL WINAPI DestroyWindow(_In_ HWND)
#define MCM_SETCALENDARBORDER
Definition: commctrl.h:4278
unsigned long DWORD
Definition: ntddk_ex.h:95
static HWND create_monthcal_control(DWORD style)
Definition: monthcal.c:649
int ret
#define skip(...)
Definition: atltest.h:64

Referenced by START_TEST().

◆ test_hittest()

static void test_hittest ( void  )
static

Definition at line 1003 of file monthcal.c.

1004 {
1005  typedef struct hittest_test
1006  {
1007  UINT ht;
1008  BOOL todo;
1009  } hittest_test_t;
1010 
1011  static const hittest_test_t title_hits[] = {
1012  /* Start is the same everywhere */
1013  { MCHT_TITLE, FALSE },
1014  { MCHT_TITLEBTNPREV, FALSE },
1015  /* The middle piece is only tested for presence of items */
1016  /* End is the same everywhere */
1017  { MCHT_TITLEBTNNEXT, FALSE },
1018  { MCHT_TITLE, FALSE },
1019  { MCHT_NOWHERE, TRUE }
1020  };
1021 
1022  MCHITTESTINFO mchit;
1023  UINT res, old_res;
1024  SYSTEMTIME st;
1025  LONG x;
1026  UINT title_index;
1027  HWND hwnd;
1028  RECT r;
1029  char yearmonth[80], *locale_month, *locale_year;
1030  int month_count, year_count;
1031  BOOL in_the_middle;
1032 
1033  memset(&mchit, 0, sizeof(MCHITTESTINFO));
1034 
1036 
1037  /* test with invalid structure size */
1038  mchit.cbSize = MCHITTESTINFO_V1_SIZE - 1;
1039  mchit.pt.x = 0;
1040  mchit.pt.y = 0;
1041  res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
1042  expect(0, mchit.pt.x);
1043  expect(0, mchit.pt.y);
1044  expect(~0u, res);
1045  expect(0, mchit.uHit);
1046  /* test with invalid pointer */
1047  res = SendMessageA(hwnd, MCM_HITTEST, 0, 0);
1048  expect(~0u, res);
1049 
1050  /* resize control to display single Calendar */
1052  if (res == 0)
1053  {
1054  win_skip("Message MCM_GETMINREQRECT unsupported. Skipping.\n");
1056  return;
1057  }
1058  MoveWindow(hwnd, 0, 0, r.right, r.bottom, FALSE);
1059 
1061 
1062  st.wYear = 2007;
1063  st.wMonth = 4;
1064  st.wDay = 11;
1065  st.wHour = 1;
1066  st.wMinute = 0;
1067  st.wSecond = 0;
1068  st.wMilliseconds = 0;
1069  st.wDayOfWeek = 0;
1070 
1071  res = SendMessageA(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st);
1072  expect(1,res);
1073 
1074  /* (0, 0) is the top left of the control - title */
1075  mchit.cbSize = MCHITTESTINFO_V1_SIZE;
1076  mchit.pt.x = 0;
1077  mchit.pt.y = 0;
1078  res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
1079  expect(0, mchit.pt.x);
1080  expect(0, mchit.pt.y);
1081  expect(mchit.uHit, res);
1083 
1084  /* bottom right of the control and should not be active */
1085  mchit.pt.x = r.right;
1086  mchit.pt.y = r.bottom;
1087  res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
1088  expect(r.right, mchit.pt.x);
1089  expect(r.bottom, mchit.pt.y);
1090  expect(mchit.uHit, res);
1092 
1093  /* completely out of the control, should not be active */
1094  mchit.pt.x = 2 * r.right;
1095  mchit.pt.y = 2 * r.bottom;
1096  res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
1097  expect(2 * r.right, mchit.pt.x);
1098  expect(2 * r.bottom, mchit.pt.y);
1099  expect(mchit.uHit, res);
1101 
1102  /* in active area - day of the week */
1103  mchit.pt.x = r.right / 2;
1104  mchit.pt.y = r.bottom / 2;
1105  res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
1106  expect(r.right / 2, mchit.pt.x);
1107  expect(r.bottom / 2, mchit.pt.y);
1108  expect(mchit.uHit, res);
1110 
1111  /* in active area - day of the week #2 */
1112  mchit.pt.x = r.right / 14; /* half of first day rect */
1113  mchit.pt.y = r.bottom / 2;
1114  res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
1115  expect(r.right / 14, mchit.pt.x);
1116  expect(r.bottom / 2, mchit.pt.y);
1117  expect(mchit.uHit, res);
1119 
1120  /* in active area - date from prev month */
1121  mchit.pt.x = r.right / 14; /* half of first day rect */
1122  mchit.pt.y = 6 * r.bottom / 19;
1123  res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
1124  expect(r.right / 14, mchit.pt.x);
1125  expect(6 * r.bottom / 19, mchit.pt.y);
1126  expect(mchit.uHit, res);
1128 
1129 if (0)
1130 {
1131  /* (125, 115) is in active area - date from this month */
1132  mchit.pt.x = 125;
1133  mchit.pt.y = 115;
1134  res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
1135  expect(125, mchit.pt.x);
1136  expect(115, mchit.pt.y);
1137  expect(mchit.uHit, res);
1139 }
1140 
1141  /* in active area - date from next month */
1142  mchit.pt.x = 11 * r.right / 14;
1143  mchit.pt.y = 16 * r.bottom / 19;
1144  res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
1145  expect(11 * r.right / 14, mchit.pt.x);
1146  expect(16 * r.bottom / 19, mchit.pt.y);
1147  expect(mchit.uHit, res);
1149 
1150  /* in active area - today link */
1151  mchit.pt.x = r.right / 14;
1152  mchit.pt.y = 18 * r.bottom / 19;
1153  res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
1154  expect(r.right / 14, mchit.pt.x);
1155  expect(18 * r.bottom / 19, mchit.pt.y);
1156  expect(mchit.uHit, res);
1158 
1159  /* in active area - today link */
1160  mchit.pt.x = r.right / 2;
1161  mchit.pt.y = 18 * r.bottom / 19;
1162  res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
1163  expect(r.right / 2, mchit.pt.x);
1164  expect(18 * r.bottom / 19, mchit.pt.y);
1165  expect(mchit.uHit, res);
1167 
1168  /* in active area - today link */
1169  mchit.pt.x = r.right / 10;
1170  mchit.pt.y = 18 * r.bottom / 19;
1171  res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
1172  expect(r.right / 10, mchit.pt.x);
1173  expect(18 * r.bottom / 19, mchit.pt.y);
1174  expect(mchit.uHit, res);
1176 
1178 
1179  /* The horizontal position of title bar elements depends on locale (y pos
1180  is constant), so we sample across a horizontal line and make sure we
1181  find all elements. */
1182 
1183  /* Get the format of the title */
1184  GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SYEARMONTH, yearmonth, 80);
1185  /* Find out if we have a month and/or year */
1186  locale_year = strstr(yearmonth, "y");
1187  locale_month = strstr(yearmonth, "M");
1188 
1189  mchit.pt.x = 0;
1190  mchit.pt.y = (5/2) * r.bottom / 19;
1191  title_index = 0;
1192  old_res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
1193  expect_hex(title_hits[title_index].ht, old_res);
1194 
1195  in_the_middle = FALSE;
1196  month_count = year_count = 0;
1197  for (x = 0; x < r.right; x++){
1198  mchit.pt.x = x;
1199  res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
1200  expect(x, mchit.pt.x);
1201  expect((5/2) * r.bottom / 19, mchit.pt.y);
1202  expect(mchit.uHit, res);
1203  if (res != old_res) {
1204 
1205  if (old_res == MCHT_TITLEBTNPREV)
1206  in_the_middle = TRUE;
1207 
1208  if (res == MCHT_TITLEBTNNEXT)
1209  in_the_middle = FALSE;
1210 
1211  if (in_the_middle) {
1212  if (res == MCHT_TITLEMONTH)
1213  month_count++;
1214  else if (res == MCHT_TITLEYEAR)
1215  year_count++;
1216  } else {
1217  title_index++;
1218 
1219  if (ARRAY_SIZE(title_hits) <= title_index)
1220  break;
1221 
1222  todo_wine_if(title_hits[title_index].todo)
1223  ok(title_hits[title_index].ht == res, "Expected %x, got %x, pos %d\n",
1224  title_hits[title_index].ht, res, x);
1225  }
1226  old_res = res;
1227  }
1228  }
1229 
1230  /* There are some limits, even if LOCALE_SYEARMONTH contains rubbish
1231  * or no month/year indicators at all */
1232  if (locale_month)
1233  todo_wine ok(month_count == 1, "Expected 1 month item, got %d\n", month_count);
1234  else
1235  ok(month_count <= 1, "Too many month items: %d\n", month_count);
1236 
1237  if (locale_year)
1238  todo_wine ok(year_count == 1, "Expected 1 year item, got %d\n", year_count);
1239  else
1240  ok(year_count <= 1, "Too many year items: %d\n", year_count);
1241 
1242  todo_wine ok(month_count + year_count >= 1, "Not enough month and year items\n");
1243 
1244  ok(r.right <= x && title_index + 1 == ARRAY_SIZE(title_hits), "Wrong title layout\n");
1245 
1247 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define MCHT_CALENDARDATENEXT
Definition: commctrl.h:4249
#define TRUE
Definition: types.h:120
#define NUM_MSG_SEQUENCES
Definition: monthcal.c:39
#define MCHT_CALENDARDATE
Definition: commctrl.h:4248
long y
Definition: polytest.cpp:48
#define MCHT_TITLEBTNPREV
Definition: commctrl.h:4245
long x
Definition: polytest.cpp:48
WORD wMonth
Definition: winbase.h:878
#define MCM_GETMINREQRECT
Definition: commctrl.h:4196
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MCHT_TITLEBTNNEXT
Definition: commctrl.h:4244
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
INT WINAPI GetLocaleInfoA(LCID lcid, LCTYPE lctype, LPSTR buffer, INT len)
Definition: lang.c:1018
#define LOCALE_USER_DEFAULT
WORD wDayOfWeek
Definition: winbase.h:879
#define MONTHCAL_SEQ_INDEX
Definition: monthcal.c:41
BOOL todo
Definition: filedlg.c:313
#define expect(expected, got)
Definition: monthcal.c:35
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define MCHT_TODAYLINK
Definition: commctrl.h:4234
BOOL WINAPI DestroyWindow(_In_ HWND)
#define expect_hex(expected, got)
Definition: monthcal.c:36
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: monthcal.c:47
WORD wYear
Definition: winbase.h:877
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
WORD wMinute
Definition: winbase.h:882
#define MCM_HITTEST
Definition: commctrl.h:4214
LONG_PTR LPARAM
Definition: windef.h:208
#define MCM_SETCURSEL
Definition: commctrl.h:4182
#define todo_wine_if(is_todo)
Definition: test.h:155
#define MCHT_TITLE
Definition: commctrl.h:4232
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
static HWND create_monthcal_control(DWORD style)
Definition: monthcal.c:649
WORD wSecond
Definition: winbase.h:883
WORD wMilliseconds
Definition: winbase.h:884
#define todo_wine
Definition: test.h:154
#define MCHT_TITLEMONTH
Definition: commctrl.h:4242
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
WORD wDay
Definition: winbase.h:880
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
WORD wHour
Definition: winbase.h:881
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
static const struct newhuff ht[]
Definition: huffman.h:296
unsigned int UINT
Definition: ndis.h:50
#define MCHITTESTINFO_V1_SIZE
Definition: commctrl.h:4230
static const struct message monthcal_hit_test_seq[]
Definition: monthcal.c:167
GLuint res
Definition: glext.h:9613
#define MCHT_NOWHERE
Definition: commctrl.h:4239
#define memset(x, y, z)
Definition: compat.h:39
#define win_skip
Definition: test.h:141
#define MCHT_CALENDARDATEPREV
Definition: commctrl.h:4250
#define MCHT_TITLEYEAR
Definition: commctrl.h:4243

Referenced by START_TEST().

◆ test_hittest_v6()

static void test_hittest_v6 ( void  )
static

Definition at line 1757 of file monthcal.c.

1758 {
1759  MCHITTESTINFO mchit;
1760  DWORD ret;
1761  HWND hwnd;
1762  RECT r;
1763 
1766 
1768  /* reserving some area around calendar */
1769  MoveWindow(hwnd, 0, 0, r.right * 3 / 2, r.bottom * 3 / 2, FALSE);
1770  mchit.cbSize = sizeof(MCHITTESTINFO);
1771  mchit.pt.x = mchit.pt.y = 0;
1772  mchit.iOffset = -1;
1773  mchit.iRow = -1;
1774  mchit.iCol = -1;
1775  ret = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
1776  if (ret == ~0u)
1777  {
1778  win_skip("Only MCHITTESTINFO_V1 supported\n");
1780  return;
1781  }
1783  expect(-1, mchit.iOffset);
1784  expect(-1, mchit.iRow);
1785  expect(-1, mchit.iCol);
1786 
1787  MoveWindow(hwnd, 0, 0, r.right, r.bottom, FALSE);
1788  mchit.pt.x = r.right / 2;
1789  mchit.pt.y = r.bottom / 2;
1790  mchit.iOffset = -1;
1791  ret = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
1793  expect(0, mchit.iOffset);
1794 
1795  /* over day area */
1796  mchit.pt.x = r.right / (7*2);
1797  mchit.pt.y = r.bottom / 2;
1798  mchit.iOffset = -1;
1799  mchit.iCol = mchit.iRow = -1;
1800  mchit.uHit = 0;
1801  SetRect(&mchit.rc, -1, -1, -1, -1);
1802  ret = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
1805  expect(0, mchit.iOffset);
1806  expect(2, mchit.iRow);
1807  expect(0, mchit.iCol);
1808  /* returned a one day rectangle */
1809  expect_d(r.right / 7, mchit.rc.right - mchit.rc.left);
1810  expect_d(r.bottom / 10, mchit.rc.bottom - mchit.rc.top);
1811 
1812  /* title */
1813  mchit.pt.x = 1;
1814  mchit.pt.y = 1;
1815  mchit.iOffset = -1;
1816  mchit.iCol = mchit.iRow = -1;
1817  mchit.uHit = 0;
1818  SetRect(&mchit.rc, -1, -1, -1, -1);
1819  ret = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
1821  expect_hex(MCHT_TITLE, mchit.uHit);
1822  expect(0, mchit.iOffset);
1823  expect(-1, mchit.iRow);
1824  expect(-1, mchit.iCol);
1825  expect(0, mchit.rc.left);
1826  expect(0, mchit.rc.top);
1827  expect_d(r.right, mchit.rc.right);
1828  ok(mchit.rc.bottom > 0, "got %d\n", mchit.rc.bottom);
1829 
1830  /* between two calendars */
1831  MoveWindow(hwnd, 0, 0, r.right * 5/2, r.bottom, FALSE);
1832  mchit.pt.x = r.right / (5*4);
1833  mchit.pt.y = r.bottom / 2;
1834  mchit.iOffset = -2;
1835  mchit.iCol = mchit.iRow = -2;
1836  mchit.uHit = ~0;
1837  SetRect(&mchit.rc, -1, -1, -1, -1);
1838  ret = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
1841  expect(-2, mchit.iOffset);
1842  expect(-2, mchit.iRow);
1843  expect(-2, mchit.iCol);
1844  todo_wine expect(0, mchit.rc.left);
1845  todo_wine expect(0, mchit.rc.top);
1846  todo_wine expect_d(r.right * 5/2, mchit.rc.right);
1847  todo_wine expect_d(r.bottom, mchit.rc.bottom);
1848 
1850 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define MCHT_CALENDARDATE
Definition: commctrl.h:4248
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define MCM_GETMINREQRECT
Definition: commctrl.h:4196
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
LONG top
Definition: windef.h:292
#define expect(expected, got)
Definition: monthcal.c:35
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
BOOL WINAPI DestroyWindow(_In_ HWND)
#define expect_hex(expected, got)
Definition: monthcal.c:36
#define MCM_SETCALENDARBORDER
Definition: commctrl.h:4278
#define MCM_HITTEST
Definition: commctrl.h:4214
LONG_PTR LPARAM
Definition: windef.h:208
#define MCHT_TITLE
Definition: commctrl.h:4232
unsigned long DWORD
Definition: ntddk_ex.h:95
static HWND create_monthcal_control(DWORD style)
Definition: monthcal.c:649
int ret
#define todo_wine
Definition: test.h:154
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define ok(value,...)
Definition: atltest.h:57
LONG bottom
Definition: windef.h:294
#define MCHT_NOWHERE
Definition: commctrl.h:4239
#define expect_d(expected, got)
Definition: monthcal.c:37
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_killfocus()

static void test_killfocus ( void  )
static

Definition at line 1735 of file monthcal.c.

1736 {
1737  HWND hwnd;
1738  DWORD style;
1739 
1741 
1742  /* make parent invisible */
1745 
1747 
1749  ok(style & WS_VISIBLE, "Expected WS_VISIBLE to be set\n");
1750 
1753 
1755 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
UINT_PTR WPARAM
Definition: windef.h:207
BOOL WINAPI DestroyWindow(_In_ HWND)
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:652
#define WM_KILLFOCUS
Definition: winuser.h:1596
unsigned long DWORD
Definition: ntddk_ex.h:95
static HWND create_monthcal_control(DWORD style)
Definition: monthcal.c:649
#define GWL_STYLE
Definition: winuser.h:846
#define ok(value,...)
Definition: atltest.h:57
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620
static HWND parent_wnd
Definition: monthcal.c:49

Referenced by START_TEST().

◆ test_maxselday()

static void test_maxselday ( void  )
static

Definition at line 1493 of file monthcal.c.

1494 {
1495  int res;
1496  HWND hwnd;
1497  DWORD style;
1498 
1500  /* if no style specified default to 1 */
1502  expect(1, res);
1504  expect(0, res);
1506  expect(1, res);
1507 
1508  /* try to set style */
1512  ok(!(style & MCS_MULTISELECT), "Expected MCS_MULTISELECT not to be set\n");
1514 
1516  /* try to remove style */
1520  ok(style & MCS_MULTISELECT, "Expected MCS_MULTISELECT to be set\n");
1522 
1524 
1525  /* default width is a week */
1527  expect(7, res);
1528 
1530 
1531  /* Setter and Getters for max selected days */
1533  expect(1, res);
1535  expect(5, res);
1536 
1538  expect(1, res);
1540  expect(15, res);
1541 
1542  /* test invalid value */
1544  expect(0, res);
1546  expect(15, res);
1547 
1549 
1550  /* zero value is invalid too */
1552  expect(0, res);
1554  expect(15, res);
1555 
1557 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define NUM_MSG_SEQUENCES
Definition: monthcal.c:39
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MONTHCAL_SEQ_INDEX
Definition: monthcal.c:41
#define MCM_SETMAXSELCOUNT
Definition: commctrl.h:4186
#define expect(expected, got)
Definition: monthcal.c:35
BOOL WINAPI DestroyWindow(_In_ HWND)
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: monthcal.c:47
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define MCS_MULTISELECT
Definition: commctrl.h:4304
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
unsigned long DWORD
Definition: ntddk_ex.h:95
static HWND create_monthcal_control(DWORD style)
Definition: monthcal.c:649
static const struct message monthcal_max_sel_day_seq[]
Definition: monthcal.c:224
#define GWL_STYLE
Definition: winuser.h:846
#define ok(value,...)
Definition: atltest.h:57
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
#define MCM_GETMAXSELCOUNT
Definition: commctrl.h:4184
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
GLuint res
Definition: glext.h:9613
Arabic default style
Definition: afstyles.h:93

Referenced by START_TEST().

◆ test_MCM_GETCALENDARCOUNT()

static void test_MCM_GETCALENDARCOUNT ( void  )
static

Definition at line 1920 of file monthcal.c.

1921 {
1922  HWND hwnd;
1923  DWORD ret;
1924 
1926 
1928  if (ret == 0)
1929  {
1930  win_skip("Message MCM_GETCALENDARCOUNT unsupported. Skipping.\n");
1932  return;
1933  }
1934 
1935  expect(2, ret);
1936 
1938 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define expect(expected, got)
Definition: monthcal.c:35
BOOL WINAPI DestroyWindow(_In_ HWND)
#define MCM_GETCALENDARCOUNT
Definition: commctrl.h:4270
unsigned long DWORD
Definition: ntddk_ex.h:95
static HWND create_monthcal_control(DWORD style)
Definition: monthcal.c:649
int ret
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_MCM_SIZERECTTOMIN()

static void test_MCM_SIZERECTTOMIN ( void  )
static

Definition at line 1877 of file monthcal.c.

1878 {
1879  HWND hwnd;
1880  DWORD ret;
1881  RECT r, r2;
1882 
1884 
1886  if (ret == 0)
1887  {
1888  win_skip("Message MCM_GETMINREQRECT unsupported. Skipping.\n");
1890  return;
1891  }
1892 
1894  ok(ret == 0, "got %d\n", ret);
1895 
1896  SetRectEmpty(&r);
1898  if (ret == 0)
1899  {
1900  skip("Message MCM_SIZERECTTOMIN unsupported. Skipping.\n");
1902  return;
1903  }
1904  ok(ret == 1, "got %d\n", ret);
1905  ok(r.left == 0 && r.right > 0, "got %d, %d\n", r.left, r.right);
1906 
1907  r = r2;
1909  ok(ret == 1, "got %d\n", ret);
1910 
1911  r2.right = (r2.right - r2.left) * 3;
1912  r2.bottom = (r2.bottom - r2.top) * 3;
1913  r2.left = r2.top = 0;
1915  ok(ret == 1, "got %d\n", ret);
1916 
1918 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define MCM_GETMINREQRECT
Definition: commctrl.h:4196
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
BOOL WINAPI DestroyWindow(_In_ HWND)
#define MCM_SIZERECTTOMIN
Definition: commctrl.h:4276
LONG_PTR LPARAM
Definition: windef.h:208
static DNS_RECORDW r2
Definition: record.c:38
unsigned long DWORD
Definition: ntddk_ex.h:95
static HWND create_monthcal_control(DWORD style)
Definition: monthcal.c:649
int ret
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_monthcal()

static void test_monthcal ( void  )
static

Definition at line 261 of file monthcal.c.

262 {
263  HWND hwnd;
264  SYSTEMTIME st[2], st1[2], today;
265  int res, month_range;
266  DWORD limits;
267  BOOL r;
268 
270  0, 300, 300, 0, 0, NULL, NULL);
271  ok(hwnd != NULL, "Failed to create MonthCal\n");
272 
273  /* test range just after creation */
274  memset(&st, 0xcc, sizeof(st));
275  limits = SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st);
276  ok(limits == 0 ||
277  broken(limits == GDTR_MIN), /* comctl32 <= 4.70 */
278  "No limits should be set (%d)\n", limits);
279  if (limits == GDTR_MIN)
280  {
281  win_skip("comctl32 <= 4.70 is broken\n");
283  return;
284  }
285 
286  ok(0 == st[0].wYear ||
287  broken(1752 == st[0].wYear), /* comctl32 <= 4.72 */
288  "Expected 0, got %d\n", st[0].wYear);
289  ok(0 == st[0].wMonth ||
290  broken(9 == st[0].wMonth), /* comctl32 <= 4.72 */
291  "Expected 0, got %d\n", st[0].wMonth);
292  ok(0 == st[0].wDay ||
293  broken(14 == st[0].wDay), /* comctl32 <= 4.72 */
294  "Expected 0, got %d\n", st[0].wDay);
295  expect(0, st[0].wDayOfWeek);
296  expect(0, st[0].wHour);
297  expect(0, st[0].wMinute);
298  expect(0, st[0].wSecond);
299  expect(0, st[0].wMilliseconds);
300 
301  expect(0, st[1].wYear);
302  expect(0, st[1].wMonth);
303  expect(0, st[1].wDay);
304  expect(0, st[1].wDayOfWeek);
305  expect(0, st[1].wHour);
306  expect(0, st[1].wMinute);
307  expect(0, st[1].wSecond);
308  expect(0, st[1].wMilliseconds);
309 
310  limits = SendMessageA(hwnd, MCM_GETRANGE, 0, 0);
311  ok(limits == 0, "got %u\n", limits);
312 
313  GetSystemTime(&st[0]);
314  st[1] = st[0];
315 
316  SendMessageA(hwnd, MCM_GETTODAY, 0, (LPARAM)&today);
317 
318  /* Invalid date/time */
319  st[0].wYear = 2000;
320  /* Time should not matter */
321  st[1].wHour = st[1].wMinute = st[1].wSecond = 70;
322  st[1].wMilliseconds = 1200;
323  ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set MAX limit\n");
324  /* invalid timestamp is written back with today data and msecs untouched */
325  expect(today.wHour, st[1].wHour);
326  expect(today.wMinute, st[1].wMinute);
327  expect(today.wSecond, st[1].wSecond);
328  expect(1200, st[1].wMilliseconds);
329 
330  ok(SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MAX, "No limits should be set\n");
331  ok(st1[0].wYear != 2000, "Lower limit changed\n");
332  /* invalid timestamp should be replaced with today data, except msecs */
333  expect(today.wHour, st1[1].wHour);
334  expect(today.wMinute, st1[1].wMinute);
335  expect(today.wSecond, st1[1].wSecond);
336  expect(1200, st1[1].wMilliseconds);
337 
338  /* Invalid date/time with invalid milliseconds only */
339  GetSystemTime(&st[0]);
340  st[1] = st[0];
341  /* Time should not matter */
342  st[1].wMilliseconds = 1200;
343  ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set MAX limit\n");
344  /* invalid milliseconds field doesn't lead to invalid timestamp */
345  expect(st[0].wHour, st[1].wHour);
346  expect(st[0].wMinute, st[1].wMinute);
347  expect(st[0].wSecond, st[1].wSecond);
348  expect(1200, st[1].wMilliseconds);
349 
350  GetSystemTime(&st[0]);
351 
352  st[1].wMonth = 0;
354  "Should have failed to set limits\n");
355  ok(SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MAX, "No limits should be set\n");
356  ok(st1[0].wYear != 2000, "Lower limit changed\n");
358  "Should have failed to set MAX limit\n");
359  ok(SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MAX, "No limits should be set\n");
360  ok(st1[0].wYear != 2000, "Lower limit changed\n");
361 
362  GetSystemTime(&st[0]);
363  st[0].wDay = 20;
364  st[0].wMonth = 5;
365  st[1] = st[0];
366 
367  month_range = SendMessageA(hwnd, MCM_GETMONTHRANGE, GMR_VISIBLE, (LPARAM)st1);
368  st[1].wMonth--;
370  "Failed to set both min and max limits\n");
372  ok(res == month_range, "Invalid month range (%d)\n", res);
374  "Limits should be set\n");
375 
376  st[1].wMonth += 2;
378  "Failed to set both min and max limits\n");
380  ok(res == month_range, "Invalid month range (%d)\n", res);
381 
382  st[1].wYear --;
384  "Failed to set both min and max limits\n");
385  st[1].wYear += 1;
387  "Failed to set both min and max limits\n");
388 
389  st[1].wMonth -= 3;
390  ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set max limit\n");
392  "Only MAX limit should be set\n");
393  st[1].wMonth += 4;
394  ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set max limit\n");
395  st[1].wYear -= 3;
396  ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set max limit\n");
397  st[1].wYear += 4;
398  ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set max limit\n");
400  "Only MAX limit should be set\n");
401 
402  /* set both limits, then set max < min */
403  GetSystemTime(&st[0]);
404  st[0].wDay = 25;
405  st[1] = st[0];
406  st[1].wYear++;
407  ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MIN|GDTR_MAX, (LPARAM)st), "Failed to set limits\n");
409  "Min limit expected\n");
410  st[1].wYear -= 2;
411  ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set limits\n");
412  ok(SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MAX, "Max limit expected\n");
413 
414  expect(0, st1[0].wYear);
415  expect(0, st1[0].wMonth);
416  expect(0, st1[0].wDay);
417  expect(0, st1[0].wDayOfWeek);
418  expect(0, st1[0].wHour);
419  expect(0, st1[0].wMinute);
420  expect(0, st1[0].wSecond);
421  expect(0, st1[0].wMilliseconds);
422 
423  expect(st[1].wYear, st1[1].wYear);
424  expect(st[1].wMonth, st1[1].wMonth);
425  expect(st[1].wDay, st1[1].wDay);
426  expect(st[1].wDayOfWeek, st1[1].wDayOfWeek);
427  expect(st[1].wHour, st1[1].wHour);
428  expect(st[1].wMinute, st1[1].wMinute);
429  expect(st[1].wSecond, st1[1].wSecond);
430  expect(st[1].wMilliseconds, st1[1].wMilliseconds);
431 
432  st[1] = st[0];
433  st[1].wYear++;
434  ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MIN|GDTR_MAX, (LPARAM)st), "Failed to set limits\n");
436  "Min limit expected\n");
437  st[0].wYear++; /* start == end now */
438  ok(SendMessageA(hwnd, MCM_SETRANGE, GDTR_MIN, (LPARAM)st), "Failed to set limits\n");
439  ok(SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MIN, "Min limit expected\n");
440 
441  expect(st[0].wYear, st1[0].wYear);
442  expect(st[0].wMonth, st1[0].wMonth);
443  expect(st[0].wDay, st1[0].wDay);
444  expect(st[0].wDayOfWeek, st1[0].wDayOfWeek);
445  expect(st[0].wHour, st1[0].wHour);
446  expect(st[0].wMinute, st1[0].wMinute);
447  expect(st[0].wSecond, st1[0].wSecond);
448  expect(st[0].wMilliseconds, st1[0].wMilliseconds);
449 
450  expect(0, st1[1].wYear);
451  expect(0, st1[1].wMonth);
452  expect(0, st1[1].wDay);
453  expect(0, st1[1].wDayOfWeek);
454  expect(0, st1[1].wHour);
455  expect(0, st1[1].wMinute);
456  expect(0, st1[1].wSecond);
457  expect(0, st1[1].wMilliseconds);
458 
459  /* 0 limit flags */
460  limits = SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1);
461  ok(limits == GDTR_MIN, "got 0x%08x\n", limits);
462 
463  GetSystemTime(st);
464  st[1] = st[0];
465  st[1].wYear++;
466  r = SendMessageA(hwnd, MCM_SETRANGE, 0, (LPARAM)st);
467  ok(r, "got %d\n", r);
468 
469  limits = SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st);
470  ok(limits == 0, "got 0x%08x\n", limits);
471  ok(st[0].wYear == 0 && st[1].wYear == 0, "got %u, %u\n", st[0].wYear, st[1].wYear);
472 
473  /* flags are 0, set min limit */
474  GetSystemTime(st);
475  st[1] = st[0];
476  st[1].wYear++;
477 
479  ok(r, "got %d\n", r);
480 
481  limits = SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1);
482  ok(limits == GDTR_MIN, "got 0x%08x\n", limits);
483  ok(st1[1].wYear == 0, "got %u\n", st1[1].wYear);
484 
485  /* now set max limit, check flags */
487  ok(r, "got %d\n", r);
488 
489  limits = SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1);
490  ok(limits == GDTR_MAX, "got 0x%08x\n", limits);
491  ok(st1[0].wYear == 0, "got %u\n", st1[0].wYear);
492 
494 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
WORD wMonth
Definition: winbase.h:878
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define MCM_GETRANGE
Definition: commctrl.h:4258
#define expect(expected, got)
Definition: monthcal.c:35
#define MCM_SETRANGE
Definition: commctrl.h:4260
#define MONTHCAL_CLASSA
Definition: commctrl.h:4172
BOOL WINAPI DestroyWindow(_In_ HWND)
WORD wYear
Definition: winbase.h:877
unsigned int BOOL
Definition: ntddk_ex.h:94
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4216
#define CW_USEDEFAULT
Definition: winuser.h:225
WORD wMinute
Definition: winbase.h:882
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define MCM_GETTODAY
Definition: commctrl.h:4212
VOID WINAPI GetSystemTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:317
unsigned long DWORD
Definition: ntddk_ex.h:95
WORD wSecond
Definition: winbase.h:883
WORD wMilliseconds
Definition: winbase.h:884
#define GDTR_MAX
Definition: commctrl.h:4453
#define GDTR_MIN
Definition: commctrl.h:4452
#define broken(x)
Definition: _sntprintf.h:21
WORD wDay
Definition: winbase.h:880
#define ok(value,...)
Definition: atltest.h:57
WORD wHour
Definition: winbase.h:881
#define GMR_VISIBLE
Definition: commctrl.h:4311
#define WS_POPUP
Definition: pedump.c:616
GLuint res
Definition: glext.h:9613
#define MCM_GETMONTHRANGE
Definition: commctrl.h:4192
#define WS_VISIBLE
Definition: pedump.c:620
#define memset(x, y, z)
Definition: compat.h:39
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_monthrange()

static void test_monthrange ( void  )
static

Definition at line 1404 of file monthcal.c.

1405 {
1406  int res;
1407  SYSTEMTIME st_visible[2], st_daystate[2], st;
1408  HWND hwnd;
1409  RECT r;
1410 
1412 
1413  memset(&st_visible, 0, sizeof(st_visible));
1414  memset(&st_daystate, 0, sizeof(st_daystate));
1415 
1416  st.wYear = 2000;
1417  st.wMonth = 11;
1418  st.wDay = 28;
1419  st.wHour = 11;
1420  st.wMinute = 59;
1421  st.wSecond = 30;
1422  st.wMilliseconds = 0;
1423  st.wDayOfWeek = 0;
1424 
1425  res = SendMessageA(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st);
1426  expect(1,res);
1427 
1428  /* to be locale independent */
1430 
1432  expect(TRUE, res);
1433  /* resize control to display two Calendars */
1434  MoveWindow(hwnd, 0, 0, r.right, (5/2)*r.bottom, FALSE);
1435 
1437 
1439  expect(2, res);
1440  expect(2000, st_visible[0].wYear);
1441  expect(11, st_visible[0].wMonth);
1442  expect(1, st_visible[0].wDay);
1443  expect(2000, st_visible[1].wYear);
1444  expect(12, st_visible[1].wMonth);
1445  expect(31, st_visible[1].wDay);
1446 
1448  expect(4, res);
1449  expect(2000, st_daystate[0].wYear);
1450  expect(10, st_daystate[0].wMonth);
1451  expect(29, st_daystate[0].wDay);
1452  expect(2001, st_daystate[1].wYear);
1453  expect(1, st_daystate[1].wMonth);
1454  expect(6, st_daystate[1].wDay);
1455 
1457 
1458  /* with null date array parameter */
1460  expect(2, res);
1461 
1463  expect(4, res);
1464 
1465  /* resize control to display single Calendar */
1466  MoveWindow(hwnd, 0, 0, r.right, r.bottom, FALSE);
1467 
1468  memset(&st, 0, sizeof(st));
1469  st.wMonth = 9;
1470  st.wYear = 1752;
1471  st.wDay = 14;
1472 
1473  res = SendMessageA(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st);
1474  expect(1, res);
1475 
1476  /* September 1752 has 19 days */
1478  expect(1, res);
1479 
1480  expect(1752, st_visible[0].wYear);
1481  expect(9, st_visible[0].wMonth);
1482  ok(14 == st_visible[0].wDay ||
1483  broken(1 == st_visible[0].wDay), /* comctl32 <= 4.72 */
1484  "Expected 14, got %d\n", st_visible[0].wDay);
1485 
1486  expect(1752, st_visible[1].wYear);
1487  expect(9, st_visible[1].wMonth);
1488  expect(19, st_visible[1].wDay);
1489 
1491 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define NUM_MSG_SEQUENCES
Definition: monthcal.c:39
WORD wMonth
Definition: winbase.h:878
#define MCM_GETMINREQRECT
Definition: commctrl.h:4196
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
WORD wDayOfWeek
Definition: winbase.h:879
#define MONTHCAL_SEQ_INDEX
Definition: monthcal.c:41
#define expect(expected, got)
Definition: monthcal.c:35
BOOL WINAPI DestroyWindow(_In_ HWND)
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: monthcal.c:47
WORD wYear
Definition: winbase.h:877
WORD wMinute
Definition: winbase.h:882
#define MCM_SETFIRSTDAYOFWEEK
Definition: commctrl.h:4254
LONG_PTR LPARAM
Definition: windef.h:208
#define GMR_DAYSTATE
Definition: commctrl.h:4312
#define MCM_SETCURSEL
Definition: commctrl.h:4182
static const struct message monthcal_monthrange_seq[]
Definition: monthcal.c:218
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
static HWND create_monthcal_control(DWORD style)
Definition: monthcal.c:649
WORD wSecond
Definition: winbase.h:883
WORD wMilliseconds
Definition: winbase.h:884
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
#define broken(x)
Definition: _sntprintf.h:21
WORD wDay
Definition: winbase.h:880
#define ok(value,...)
Definition: atltest.h:57
WORD wHour
Definition: winbase.h:881
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
#define GMR_VISIBLE
Definition: commctrl.h:4311
GLuint res
Definition: glext.h:9613
#define MCM_GETMONTHRANGE
Definition: commctrl.h:4192
#define memset(x, y, z)
Definition: compat.h:39

Referenced by START_TEST().

◆ test_scroll()

static void test_scroll ( void  )
static

Definition at line 1363 of file monthcal.c.

1364 {
1365  int res;
1366  HWND hwnd;
1367 
1369 
1371  expect(2, res);
1372 
1374 
1375  /* Setter and Getters for scroll rate */
1377  expect(0, res);
1378 
1380  expect(2, res);
1382  expect(3, res);
1383 
1385  expect(3, res);
1387  expect(12, res);
1388 
1390  expect(12, res);
1392  expect(15, res);
1393 
1395  expect(15, res);
1397  expect(-5, res);
1398 
1400 
1402 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define NUM_MSG_SEQUENCES
Definition: monthcal.c:39
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MONTHCAL_SEQ_INDEX
Definition: monthcal.c:41
static const struct message monthcal_scroll_seq[]
Definition: monthcal.c:205
#define expect(expected, got)
Definition: monthcal.c:35
BOOL WINAPI DestroyWindow(_In_ HWND)
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: monthcal.c:47
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
static HWND create_monthcal_control(DWORD style)
Definition: monthcal.c:649
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
GLuint res
Definition: glext.h:9613
#define MCM_GETMONTHDELTA
Definition: commctrl.h:4262
#define MCM_SETMONTHDELTA
Definition: commctrl.h:4264

Referenced by START_TEST().

◆ test_sel_notify()

static void test_sel_notify ( void  )
static

Definition at line 1998 of file monthcal.c.

1999 {
2000  typedef struct
2001  {
2002  DWORD val;
2003  const char* name;
2004  } Monthcal_style;
2005 
2006  HWND hwnd;
2007  RECT rc;
2008  MCHITTESTINFO mchit = {sizeof(MCHITTESTINFO)};
2009  SYSTEMTIME st;
2010  Monthcal_style styles[] = {
2011  {MCS_NOTODAY, "MCS_NOTODAY"},
2012  {MCS_NOTODAY | MCS_MULTISELECT, "MCS_NOTODAY | MCS_MULTISELECT"},
2013  {MCS_DAYSTATE, "MCS_DAYSTATE"},
2014  {MCS_DAYSTATE | MCS_MULTISELECT, "MCS_DAYSTATE | MCS_MULTISELECT"}
2015  };
2016  int i;
2017 
2018  for(i = 0; i < ARRAY_SIZE(styles); i++)
2019  {
2020  hwnd = create_monthcal_control(styles[i].val);
2023  MoveWindow(hwnd, 0, 0, rc.right, rc.bottom, FALSE);
2024  /* Simulate mouse click on some unselected day to generate
2025  MCN_SELECT and MCN_SELCHANGE notifications */
2026  mchit.pt.x = rc.right / 2;
2027  mchit.pt.y = rc.bottom / 2;
2028  SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
2030  while(st.wDay == mchit.st.wDay) /* Ensure that mchit.pt points to unselected day */
2031  {
2032  mchit.pt.y++;
2033  SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
2034  }
2035  SendMessageA(hwnd, WM_LBUTTONDOWN, 0, MAKELPARAM(mchit.pt.x, mchit.pt.y));
2036  SendMessageA(hwnd, WM_LBUTTONUP, 0, MAKELPARAM(mchit.pt.x, mchit.pt.y));
2038  }
2039 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
long y
Definition: polytest.cpp:48
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
long x
Definition: polytest.cpp:48
#define MCM_GETMINREQRECT
Definition: commctrl.h:4196
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
LONG right
Definition: windef.h:293
BOOL WINAPI DestroyWindow(_In_ HWND)
#define MCS_DAYSTATE
Definition: commctrl.h:4303
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define MCM_GETCURSEL
Definition: commctrl.h:4180
#define MCM_HITTEST
Definition: commctrl.h:4214
LONG_PTR LPARAM
Definition: windef.h:208
GLuint GLfloat * val
Definition: glext.h:7180
#define SEL_NOTIFY_TEST_ID
Definition: monthcal.c:43
#define MCS_MULTISELECT
Definition: commctrl.h:4304
unsigned long DWORD
Definition: ntddk_ex.h:95
static HWND create_monthcal_control(DWORD style)
Definition: monthcal.c:649
#define SetWindowLongPtrA
Definition: winuser.h:5246
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
#define MCS_NOTODAY
Definition: commctrl.h:4307
WORD wDay
Definition: winbase.h:880
SYSTEMTIME st
Definition: commctrl.h:4221
#define ARRAY_SIZE(a)
Definition: main.h:24
#define WM_LBUTTONUP
Definition: winuser.h:1759
LONG bottom
Definition: windef.h:294
#define GWLP_ID
Definition: winuser.h:854
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by START_TEST().

◆ test_selrange()

static void test_selrange ( void  )
static

Definition at line 1629 of file monthcal.c.

1630 {
1631  HWND hwnd;
1632  SYSTEMTIME st, range[2], range2[2];
1633  BOOL ret, old_comctl32 = FALSE;
1634 
1636 
1637  /* just after creation selection should start and end today */
1638  ret = SendMessageA(hwnd, MCM_GETTODAY, 0, (LPARAM)&st);
1639  expect(TRUE, ret);
1640 
1641  memset(range, 0xcc, sizeof(range));
1643  expect(TRUE, ret);
1644  expect(st.wYear, range[0].wYear);
1645  expect(st.wMonth, range[0].wMonth);
1646  expect(st.wDay, range[0].wDay);
1647  if (range[0].wDayOfWeek != st.wDayOfWeek)
1648  {
1649  win_skip("comctl32 <= 4.70 doesn't set some values\n");
1650  old_comctl32 = TRUE;
1651  }
1652  else
1653  {
1654  expect(st.wDayOfWeek, range[0].wDayOfWeek);
1655  expect(st.wHour, range[0].wHour);
1656  expect(st.wMinute, range[0].wMinute);
1657  expect(st.wSecond, range[0].wSecond);
1658  expect(st.wMilliseconds, range[0].wMilliseconds);
1659  }
1660 
1661  expect(st.wYear, range[1].wYear);
1662  expect(st.wMonth, range[1].wMonth);
1663  expect(st.wDay, range[1].wDay);
1664  if (!old_comctl32)
1665  {
1666  expect(st.wDayOfWeek, range[1].wDayOfWeek);
1667  expect(st.wHour, range[1].wHour);
1668  expect(st.wMinute, range[1].wMinute);
1669  expect(st.wSecond, range[1].wSecond);
1670  expect(st.wMilliseconds, range[1].wMilliseconds);
1671  }
1672 
1673  /* bounds are swapped if min > max */
1674  memset(&range[0], 0, sizeof(range[0]));
1675  range[0].wYear = 2009;
1676  range[0].wMonth = 10;
1677  range[0].wDay = 5;
1678  range[1] = range[0];
1679  range[1].wDay = 3;
1680 
1682  expect(TRUE, ret);
1683 
1684  ret = SendMessageA(hwnd, MCM_GETSELRANGE, 0, (LPARAM)range2);
1685  expect(TRUE, ret);
1686 
1687  expect(range[1].wYear, range2[0].wYear);
1688  expect(range[1].wMonth, range2[0].wMonth);
1689  expect(range[1].wDay, range2[0].wDay);
1690  expect(6, range2[0].wDayOfWeek);
1691  expect(range[1].wHour, range2[0].wHour);
1692  expect(range[1].wMinute, range2[0].wMinute);
1693  expect(range[1].wSecond, range2[0].wSecond);
1694  expect(range[1].wMilliseconds, range2[0].wMilliseconds);
1695 
1696  expect(range[0].wYear, range2[1].wYear);
1697  expect(range[0].wMonth, range2[1].wMonth);
1698  expect(range[0].wDay, range2[1].wDay);
1699  expect(1, range2[1].wDayOfWeek);
1700  expect(range[0].wHour, range2[1].wHour);
1701  expect(range[0].wMinute, range2[1].wMinute);
1702  expect(range[0].wSecond, range2[1].wSecond);
1703  expect(range[0].wMilliseconds, range2[1].wMilliseconds);
1704 
1705  /* try with range larger than maximum configured */
1706  memset(&range[0], 0, sizeof(range[0]));
1707  range[0].wYear = 2009;
1708  range[0].wMonth = 10;
1709  range[0].wDay = 1;
1710  range[1] = range[0];
1711 
1713  expect(TRUE, ret);
1714 
1715  range[1] = range[0];
1716  /* default max. range is 7 days */
1717  range[1].wDay = 8;
1718 
1720  expect(FALSE, ret);
1721 
1722  ret = SendMessageA(hwnd, MCM_GETSELRANGE, 0, (LPARAM)range2);
1723  expect(TRUE, ret);
1724 
1725  expect(range[0].wYear, range2[0].wYear);
1726  expect(range[0].wMonth, range2[0].wMonth);
1727  expect(range[0].wDay, range2[0].wDay);
1728  expect(range[0].wYear, range2[1].wYear);
1729  expect(range[0].wMonth, range2[1].wMonth);
1730  expect(range[0].wDay, range2[1].wDay);
1731 
1733 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
WORD wMonth
Definition: winbase.h:878
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
WORD wDayOfWeek
Definition: winbase.h:879
#define expect(expected, got)
Definition: monthcal.c:35
#define MCM_SETSELRANGE
Definition: commctrl.h:4190
BOOL WINAPI DestroyWindow(_In_ HWND)
WORD wYear
Definition: winbase.h:877
unsigned int BOOL
Definition: ntddk_ex.h:94
WORD wMinute
Definition: winbase.h:882
LONG_PTR LPARAM
Definition: windef.h:208
#define MCM_GETTODAY
Definition: commctrl.h:4212
#define MCS_MULTISELECT
Definition: commctrl.h:4304
static HWND create_monthcal_control(DWORD style)
Definition: monthcal.c:649
WORD wSecond
Definition: winbase.h:883
WORD wMilliseconds
Definition: winbase.h:884
int ret
GLenum GLint * range
Definition: glext.h:7539
WORD wDay
Definition: winbase.h:880
WORD wHour
Definition: winbase.h:881
#define MCM_GETSELRANGE
Definition: commctrl.h:4188
#define memset(x, y, z)
Definition: compat.h:39
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_size()

static void test_size ( void  )
static

Definition at line 1559 of file monthcal.c.

1560 {
1561  int res;
1562  RECT r1, r2;
1563  HFONT hFont1, hFont2;
1564  LOGFONTA logfont;
1565  HWND hwnd;
1566 
1568 
1569  lstrcpyA(logfont.lfFaceName, "Arial");
1570  memset(&logfont, 0, sizeof(logfont));
1571  logfont.lfHeight = 12;
1572  hFont1 = CreateFontIndirectA(&logfont);
1573 
1574  logfont.lfHeight = 24;
1575  hFont2 = CreateFontIndirectA(&logfont);
1576 
1577  /* initialize to a font we can compare against */
1578  SendMessageA(hwnd, WM_SETFONT, (WPARAM)hFont1, 0);
1580  ok(res, "SendMessageA(MCM_GETMINREQRECT) failed\n");
1581 
1582  /* check that setting a larger font results in an larger rect */
1583  SendMessageA(hwnd, WM_SETFONT, (WPARAM)hFont2, 0);
1585  ok(res, "SendMessageA(MCM_GETMINREQRECT) failed\n");
1586 
1587  OffsetRect(&r1, -r1.left, -r1.top);
1588  OffsetRect(&r2, -r2.left, -r2.top);
1589 
1590  ok(r1.bottom < r2.bottom, "Failed to get larger rect with larger font\n");
1591 
1593 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define MCM_GETMINREQRECT
Definition: commctrl.h:4196
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static DNS_RECORDW r1
Definition: record.c:37
UINT_PTR WPARAM
Definition: windef.h:207
BOOL WINAPI DestroyWindow(_In_ HWND)
LONG lfHeight
Definition: dimm.idl:42
LONG_PTR LPARAM
Definition: windef.h:208
static DNS_RECORDW r2
Definition: record.c:38
static HWND create_monthcal_control(DWORD style)
Definition: monthcal.c:649
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
#define ok(value,...)
Definition: atltest.h:57
#define WM_SETFONT
Definition: winuser.h:1632
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
GLuint res
Definition: glext.h:9613
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
#define memset(x, y, z)
Definition: compat.h:39

Referenced by run_from_file(), START_TEST(), and test_bitmap_info().

◆ test_today()

static void test_today ( void  )
static

Definition at line 1306 of file monthcal.c.

1307 {
1308  SYSTEMTIME st_test, st_new;
1309  int res;
1310  HWND hwnd;
1311 
1313 
1315 
1316  /* Setter and Getters for "today" information */
1317 
1318  /* check for overflow, should be ok */
1319  memset(&st_test, 0, sizeof(st_test));
1320  st_test.wDay = 38;
1321  st_test.wMonth = 38;
1322 
1323  st_new.wDay = 27;
1324  st_new.wMonth = 27;
1325 
1326  res = SendMessageA(hwnd, MCM_SETTODAY, 0, (LPARAM)&st_test);
1327  expect(0, res);
1328 
1329  res = SendMessageA(hwnd, MCM_GETTODAY, 0, (LPARAM)&st_new);
1330  expect(1, res);
1331 
1332  /* st_test should not change */
1333  expect(38, st_test.wDay);
1334  expect(38, st_test.wMonth);
1335 
1336  /* st_new should change, overflow does not matter */
1337  expect(38, st_new.wDay);
1338  expect(38, st_new.wMonth);
1339 
1340  /* check for zero, should be ok*/
1341  st_test.wDay = 0;
1342  st_test.wMonth = 0;
1343 
1344  res = SendMessageA(hwnd, MCM_SETTODAY, 0, (LPARAM)&st_test);
1345  expect(0, res);
1346 
1347  res = SendMessageA(hwnd, MCM_GETTODAY, 0, (LPARAM)&st_new);
1348  expect(1, res);
1349 
1350  /* st_test should not change */
1351  expect(0, st_test.wDay);
1352  expect(0, st_test.wMonth);
1353 
1354  /* st_new should change to zero*/
1355  expect(0, st_new.wDay);
1356  expect(0, st_new.wMonth);
1357 
1359 
1361 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define NUM_MSG_SEQUENCES
Definition: monthcal.c:39
static const struct message monthcal_today_seq[]
Definition: monthcal.c:195
WORD wMonth
Definition: winbase.h:878
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MONTHCAL_SEQ_INDEX
Definition: monthcal.c:41
#define expect(expected, got)
Definition: monthcal.c:35
BOOL WINAPI DestroyWindow(_In_ HWND)
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: monthcal.c:47
LONG_PTR LPARAM
Definition: windef.h:208
#define MCM_GETTODAY
Definition: commctrl.h:4212
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
static HWND create_monthcal_control(DWORD style)
Definition: monthcal.c:649
WORD wDay
Definition: winbase.h:880
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
GLuint res
Definition: glext.h:9613
#define memset(x, y, z)
Definition: compat.h:39
#define MCM_SETTODAY
Definition: commctrl.h:4210

Referenced by START_TEST().

◆ test_todaylink()

static void test_todaylink ( void  )
static

Definition at line 1249 of file monthcal.c.

1250 {
1251  MCHITTESTINFO mchit;
1252  SYSTEMTIME st_test, st_new;
1253  UINT res;
1254  HWND hwnd;
1255  RECT r;
1256 
1257  memset(&mchit, 0, sizeof(MCHITTESTINFO));
1258 
1260 
1262  expect(1, res);
1263  MoveWindow(hwnd, 0, 0, r.right, r.bottom, FALSE);
1264 
1266 
1267  /* hit active area - today link */
1268  mchit.cbSize = MCHITTESTINFO_V1_SIZE;
1269  mchit.pt.x = r.right / 14;
1270  mchit.pt.y = 18 * r.bottom / 19;
1271  res = SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
1272  expect(r.right / 14, mchit.pt.x);
1273  expect(18 * r.bottom / 19, mchit.pt.y);
1274  expect(mchit.uHit, res);
1276 
1277  st_test.wDay = 1;
1278  st_test.wMonth = 1;
1279  st_test.wYear = 2005;
1280 
1281  res = SendMessageA(hwnd, MCM_SETTODAY, 0, (LPARAM)&st_test);
1282  expect(0, res);
1283 
1284  memset(&st_new, 0, sizeof(st_new));
1285  res = SendMessageA(hwnd, MCM_GETTODAY, 0, (LPARAM)&st_new);
1286  expect(1, res);
1287  expect(1, st_new.wDay);
1288  expect(1, st_new.wMonth);
1289  expect(2005, st_new.wYear);
1290 
1291  res = SendMessageA(hwnd, WM_LBUTTONDOWN, MK_LBUTTON, MAKELONG(mchit.pt.x, mchit.pt.y));
1292  expect(0, res);
1293 
1294  memset(&st_new, 0, sizeof(st_new));
1295  res = SendMessageA(hwnd, MCM_GETCURSEL, 0, (LPARAM)&st_new);
1296  expect(1, res);
1297  expect(1, st_new.wDay);
1298  expect(1, st_new.wMonth);
1299  expect(2005, st_new.wYear);
1300 
1302 
1304 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define NUM_MSG_SEQUENCES
Definition: monthcal.c:39
long y
Definition: polytest.cpp:48
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
#define MK_LBUTTON
Definition: winuser.h:2342
long x
Definition: polytest.cpp:48
WORD wMonth
Definition: winbase.h:878
#define MCM_GETMINREQRECT
Definition: commctrl.h:4196
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define MONTHCAL_SEQ_INDEX
Definition: monthcal.c:41
#define expect(expected, got)
Definition: monthcal.c:35
static const struct message monthcal_todaylink_seq[]
Definition: monthcal.c:183
#define MCHT_TODAYLINK
Definition: commctrl.h:4234
BOOL WINAPI DestroyWindow(_In_ HWND)
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: monthcal.c:47
WORD wYear
Definition: winbase.h:877
#define MCM_GETCURSEL
Definition: commctrl.h:4180
#define MAKELONG(a, b)
Definition: typedefs.h:248
#define MCM_HITTEST
Definition: commctrl.h:4214
LONG_PTR LPARAM
Definition: windef.h:208
#define MCM_GETTODAY
Definition: commctrl.h:4212
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
static HWND create_monthcal_control(DWORD style)
Definition: monthcal.c:649
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
WORD wDay
Definition: winbase.h:880
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
unsigned int UINT
Definition: ndis.h:50
#define MCHITTESTINFO_V1_SIZE
Definition: commctrl.h:4230
GLuint res
Definition: glext.h:9613
#define memset(x, y, z)
Definition: compat.h:39
#define MCM_SETTODAY
Definition: commctrl.h:4210

Referenced by START_TEST().

◆ test_unicode()

static void test_unicode ( void  )
static

Definition at line 960 of file monthcal.c.

961 {
962  int res, temp;
963  HWND hwnd;
964 
966 
968 
969  /* Setter and Getters for Unicode format */
970 
971  /* getting the current settings */
973 
974  /* setting to 1, should return previous settings */
976  expect(temp, res);
977 
978  /* current setting is 1, so, should return 1 */
980  ok(1 == res ||
981  broken(0 == res), /* comctl32 <= 4.70 */
982  "Expected 1, got %d\n", res);
983 
984  /* setting to 0, should return previous settings */
986  ok(1 == res ||
987  broken(0 == res), /* comctl32 <= 4.70 */
988  "Expected 1, got %d\n", res);
989 
990  /* current setting is 0, so, it should return 0 */
992  expect(0, res);
993 
994  /* should return previous settings */
996  expect(0, res);
997 
999 
1001 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define NUM_MSG_SEQUENCES
Definition: monthcal.c:39
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MONTHCAL_SEQ_INDEX
Definition: monthcal.c:41
#define expect(expected, got)
Definition: monthcal.c:35
#define MCM_SETUNICODEFORMAT
Definition: commctrl.h:4272
#define MCM_GETUNICODEFORMAT
Definition: commctrl.h:4274
BOOL WINAPI DestroyWindow(_In_ HWND)
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: monthcal.c:47
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
static HWND create_monthcal_control(DWORD style)
Definition: monthcal.c:649
static const struct message monthcal_unicode_seq[]
Definition: monthcal.c:157
#define broken(x)
Definition: _sntprintf.h:21
static calc_node_t temp
Definition: rpn_ieee.c:38
#define ok(value,...)
Definition: atltest.h:57
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
GLuint res
Definition: glext.h:9613

Referenced by START_TEST(), and testScreenBuffer().

Variable Documentation

◆ create_monthcal_control_seq

const struct message create_monthcal_control_seq[]
static
Initial value:
= {
{ WM_NOTIFYFORMAT, sent|lparam, 0, NF_QUERY },
{ WM_QUERYUISTATE, sent|optional },
{ 0 }
}
#define WM_PARENTNOTIFY
Definition: winuser.h:1785
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define WM_GETFONT
Definition: winuser.h:1633
Definition: msg.h:41
Definition: msg.h:34
#define NF_QUERY
Definition: winuser.h:2435
#define WM_CREATE
Definition: winuser.h:1590
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 75 of file monthcal.c.

Referenced by test_create().

◆ create_monthcal_multi_sel_style_seq

const struct message create_monthcal_multi_sel_style_seq[]
static
Initial value:
= {
{ WM_NOTIFYFORMAT, sent|lparam, 0, NF_QUERY },
{ WM_QUERYUISTATE, sent|optional },
{ 0 }
}
#define WM_PARENTNOTIFY
Definition: winuser.h:1785
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define WM_GETFONT
Definition: winuser.h:1633
Definition: msg.h:41
Definition: msg.h:34
#define NF_QUERY
Definition: winuser.h:2435

Definition at line 83 of file monthcal.c.

Referenced by test_create().

◆ create_parent_window_seq

const struct message create_parent_window_seq[]
static
Initial value:
= {
{ WM_SIZE, sent },
{ WM_MOVE, sent },
{ 0 }
}
#define WM_IME_NOTIFY
Definition: winuser.h:1812
#define WM_NCCALCSIZE
Definition: winuser.h:1667
Definition: msg.h:39
#define WM_SHOWWINDOW
Definition: winuser.h:1610
#define WM_MOVE
Definition: winuser.h:1592
#define WM_NCCREATE
Definition: winuser.h:1665
#define WM_NCACTIVATE
Definition: winuser.h:1670
Definition: msg.h:41
#define WM_QUERYNEWPALETTE
Definition: winuser.h:1860
#define WM_SIZE
Definition: winuser.h:1593
#define WM_IME_SETCONTEXT
Definition: winuser.h:1811
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1643
Definition: msg.h:34
#define WM_ACTIVATEAPP
Definition: winuser.h:1614
#define WM_ACTIVATE
Definition: winuser.h:1594
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1644
#define WM_CREATE
Definition: winuser.h:1590
#define WM_SETFOCUS
Definition: winuser.h:1595
#define WM_GETMINMAXINFO
Definition: winuser.h:1622
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 51 of file monthcal.c.

Referenced by create_parent_window().

◆ destroy_monthcal_child_msgs_seq

const struct message destroy_monthcal_child_msgs_seq[]
static
Initial value:
= {
{ 0x0090, sent|optional },
{ 0 }
}
#define WM_SHOWWINDOW
Definition: winuser.h:1610
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:41
#define WM_DESTROY
Definition: winuser.h:1591
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1643
#define WM_NCDESTROY
Definition: winuser.h:1666
Definition: msg.h:34
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1644
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 241 of file monthcal.c.

Referenced by test_destroy().

◆ destroy_monthcal_multi_sel_style_seq

const struct message destroy_monthcal_multi_sel_style_seq[]
static
Initial value:
= {
{ 0x0090, sent|optional },
{ 0 }
}
#define WM_SHOWWINDOW
Definition: winuser.h:1610
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:41
#define WM_DESTROY
Definition: winuser.h:1591
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1643
#define WM_NCDESTROY
Definition: winuser.h:1666
Definition: msg.h:34
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1644
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 251 of file monthcal.c.

Referenced by test_destroy().

◆ destroy_monthcal_parent_msgs_seq

const struct message destroy_monthcal_parent_msgs_seq[]
static
Initial value:
= {
{ 0 }
}
#define WM_PARENTNOTIFY
Definition: winuser.h:1785
#define WM_DESTROY
Definition: winuser.h:1591
Definition: msg.h:34
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 235 of file monthcal.c.

Referenced by test_destroy().

◆ monthcal_curr_date_seq

const struct message monthcal_curr_date_seq[]
static
Initial value:
= {
{ 0 }
}
Definition: msg.h:39
#define MCM_GETCURSEL
Definition: commctrl.h:4180
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define MCM_SETCURSEL
Definition: commctrl.h:4182
#define WM_PAINT
Definition: winuser.h:1602
Definition: msg.h:34
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 91 of file monthcal.c.

Referenced by test_currdate().

◆ monthcal_first_day_seq

const struct message monthcal_first_day_seq[]
static

Definition at line 101 of file monthcal.c.

Referenced by test_firstDay().

◆ monthcal_hit_test_seq

const struct message monthcal_hit_test_seq[]
static
Initial value:
= {
{ 0 }
}
Definition: msg.h:39
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define MCM_HITTEST
Definition: commctrl.h:4214
#define MCM_SETCURSEL
Definition: commctrl.h:4182
#define WM_PAINT
Definition: winuser.h:1602
Definition: msg.h:34
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 167 of file monthcal.c.

Referenced by test_hittest().

◆ monthcal_max_sel_day_seq

const struct message monthcal_max_sel_day_seq[]
static
Initial value:
= {
{ 0 }
}
#define MCM_SETMAXSELCOUNT
Definition: commctrl.h:4186
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:34
#define MCM_GETMAXSELCOUNT
Definition: commctrl.h:4184
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 224 of file monthcal.c.

Referenced by test_maxselday().

◆ monthcal_monthrange_seq

const struct message monthcal_monthrange_seq[]
static
Initial value:
= {
{ 0 }
}
#define GMR_DAYSTATE
Definition: commctrl.h:4312
Definition: msg.h:34
#define GMR_VISIBLE
Definition: commctrl.h:4311
#define MCM_GETMONTHRANGE
Definition: commctrl.h:4192
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 218 of file monthcal.c.

Referenced by test_monthrange().

◆ monthcal_scroll_seq

const struct message monthcal_scroll_seq[]
static
Initial value:
= {
{ 0 }
}
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:34
#define MCM_GETMONTHDELTA
Definition: commctrl.h:4262
#define MCM_SETMONTHDELTA
Definition: commctrl.h:4264
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 205 of file monthcal.c.

Referenced by test_scroll().

◆ monthcal_today_seq

const struct message monthcal_today_seq[]
static
Initial value:
= {
{ 0 }
}
Definition: msg.h:39
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define MCM_GETTODAY
Definition: commctrl.h:4212
#define WM_PAINT
Definition: winuser.h:1602
Definition: msg.h:34
static UINT WPARAM wparam
Definition: combo.c:716
#define MCM_SETTODAY
Definition: commctrl.h:4210

Definition at line 195 of file monthcal.c.

Referenced by test_today().

◆ monthcal_todaylink_seq

const struct message monthcal_todaylink_seq[]
static
Initial value:
= {
{ 0 }
}
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
#define MK_LBUTTON
Definition: winuser.h:2342
Definition: msg.h:39
#define WM_CAPTURECHANGED
Definition: winuser.h:1790
#define MCM_GETCURSEL
Definition: commctrl.h:4180
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define MCM_HITTEST
Definition: commctrl.h:4214
#define MCM_GETTODAY
Definition: commctrl.h:4212
#define WM_PAINT
Definition: winuser.h:1602
Definition: msg.h:34
static UINT WPARAM wparam
Definition: combo.c:716
#define MCM_SETTODAY
Definition: commctrl.h:4210

Definition at line 183 of file monthcal.c.

Referenced by test_todaylink().

◆ monthcal_unicode_seq

const struct message monthcal_unicode_seq[]
static
Initial value:
= {
{ 0 }
}
#define MCM_SETUNICODEFORMAT
Definition: commctrl.h:4272
#define MCM_GETUNICODEFORMAT
Definition: commctrl.h:4274
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:34
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 157 of file monthcal.c.

Referenced by test_unicode().

◆ parent_wnd

HWND parent_wnd
static

Definition at line 49 of file monthcal.c.

Referenced by create_monthcal_control(), START_TEST(), test_change_focus(), and test_killfocus().

◆ sequences