Skip to content
Snippets Groups Projects
Commit 44ebba9d authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard
Browse files

comctl32/tests: Preparation for switching __WINESRC__ on.

parent 947cce79
No related branches found
No related tags found
No related merge requests found
......@@ -49,37 +49,37 @@ static HWND createComboEx(DWORD style) {
hComboExParentWnd, NULL, hMainHinst, NULL);
}
static LONG addItem(HWND cbex, int idx, LPTSTR text) {
COMBOBOXEXITEM cbexItem;
static LONG addItem(HWND cbex, int idx, const char *text) {
COMBOBOXEXITEMA cbexItem;
memset(&cbexItem, 0x00, sizeof(cbexItem));
cbexItem.mask = CBEIF_TEXT;
cbexItem.iItem = idx;
cbexItem.pszText = text;
cbexItem.pszText = (char*)text;
cbexItem.cchTextMax = 0;
return SendMessage(cbex, CBEM_INSERTITEM, 0, (LPARAM)&cbexItem);
return SendMessageA(cbex, CBEM_INSERTITEMA, 0, (LPARAM)&cbexItem);
}
static LONG setItem(HWND cbex, int idx, LPTSTR text) {
COMBOBOXEXITEM cbexItem;
static LONG setItem(HWND cbex, int idx, const char *text) {
COMBOBOXEXITEMA cbexItem;
memset(&cbexItem, 0x00, sizeof(cbexItem));
cbexItem.mask = CBEIF_TEXT;
cbexItem.iItem = idx;
cbexItem.pszText = text;
cbexItem.pszText = (char*)text;
cbexItem.cchTextMax = 0;
return SendMessage(cbex, CBEM_SETITEM, 0, (LPARAM)&cbexItem);
return SendMessageA(cbex, CBEM_SETITEMA, 0, (LPARAM)&cbexItem);
}
static LONG delItem(HWND cbex, int idx) {
return SendMessage(cbex, CBEM_DELETEITEM, idx, 0);
return SendMessageA(cbex, CBEM_DELETEITEM, idx, 0);
}
static LONG getItem(HWND cbex, int idx, COMBOBOXEXITEM *cbItem) {
memset(cbItem, 0x00, sizeof(COMBOBOXEXITEM));
static LONG getItem(HWND cbex, int idx, COMBOBOXEXITEMA *cbItem) {
memset(cbItem, 0x00, sizeof(COMBOBOXEXITEMA));
cbItem->mask = CBEIF_TEXT;
cbItem->pszText = textBuffer;
cbItem->iItem = idx;
cbItem->cchTextMax = 100;
return SendMessage(cbex, CBEM_GETITEM, 0, (LPARAM)cbItem);
return SendMessageA(cbex, CBEM_GETITEMA, 0, (LPARAM)cbItem);
}
static LRESULT WINAPI editbox_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
......@@ -118,7 +118,7 @@ static HWND subclass_editbox(HWND hwndComboEx)
WNDPROC oldproc;
HWND hwnd;
hwnd = (HWND)SendMessage(hwndComboEx, CBEM_GETEDITCONTROL, 0, 0);
hwnd = (HWND)SendMessageA(hwndComboEx, CBEM_GETEDITCONTROL, 0, 0);
oldproc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC,
(LONG_PTR)editbox_subclass_proc);
SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)oldproc);
......@@ -129,15 +129,13 @@ static HWND subclass_editbox(HWND hwndComboEx)
static void test_comboboxex(void) {
HWND myHwnd = 0;
LONG res = -1;
COMBOBOXEXITEM cbexItem;
static TCHAR first_item[] = {'F','i','r','s','t',' ','I','t','e','m',0},
second_item[] = {'S','e','c','o','n','d',' ','I','t','e','m',0},
third_item[] = {'T','h','i','r','d',' ','I','t','e','m',0},
middle_item[] = {'B','e','t','w','e','e','n',' ','F','i','r','s','t',' ','a','n','d',' ',
'S','e','c','o','n','d',' ','I','t','e','m','s',0},
replacement_item[] = {'B','e','t','w','e','e','n',' ','F','i','r','s','t',' ','a','n','d',' ',
'S','e','c','o','n','d',' ','I','t','e','m','s',0},
out_of_range_item[] = {'O','u','t',' ','o','f',' ','R','a','n','g','e',' ','I','t','e','m',0};
COMBOBOXEXITEMA cbexItem;
static const char *first_item = "First Item",
*second_item = "Second Item",
*third_item = "Third Item",
*middle_item = "Between First and Second Items",
*replacement_item = "Between First and Second Items",
*out_of_range_item = "Out of Range Item";
/* Allocate space for result */
textBuffer = HeapAlloc(GetProcessHeap(), 0, MAX_CHARS);
......@@ -267,8 +265,8 @@ static void test_WM_LBUTTONDOWN(void)
"Failed to add item %d\n", i);
}
hCombo = (HWND)SendMessage(hComboEx, CBEM_GETCOMBOCONTROL, 0, 0);
hEdit = (HWND)SendMessage(hComboEx, CBEM_GETEDITCONTROL, 0, 0);
hCombo = (HWND)SendMessageA(hComboEx, CBEM_GETCOMBOCONTROL, 0, 0);
hEdit = (HWND)SendMessageA(hComboEx, CBEM_GETEDITCONTROL, 0, 0);
cbInfo.cbSize = sizeof(COMBOBOXINFO);
result = pGetComboBoxInfo(hCombo, &cbInfo);
......@@ -282,19 +280,19 @@ static void test_WM_LBUTTONDOWN(void)
/* Click on the button to drop down the list */
x = cbInfo.rcButton.left + (cbInfo.rcButton.right-cbInfo.rcButton.left)/2;
y = cbInfo.rcButton.top + (cbInfo.rcButton.bottom-cbInfo.rcButton.top)/2;
result = SendMessage(hCombo, WM_LBUTTONDOWN, 0, MAKELPARAM(x, y));
result = SendMessageA(hCombo, WM_LBUTTONDOWN, 0, MAKELPARAM(x, y));
ok(result, "WM_LBUTTONDOWN was not processed. LastError=%d\n",
GetLastError());
ok(GetFocus() == hCombo ||
broken(GetFocus() != hCombo), /* win98 */
"Focus not on ComboBoxEx's ComboBox Control, instead on %p\n",
GetFocus());
ok(SendMessage(hComboEx, CB_GETDROPPEDSTATE, 0, 0),
ok(SendMessageA(hComboEx, CB_GETDROPPEDSTATE, 0, 0),
"The dropdown list should have appeared after clicking the button.\n");
idx = SendMessage(hCombo, CB_GETTOPINDEX, 0, 0);
idx = SendMessageA(hCombo, CB_GETTOPINDEX, 0, 0);
ok(idx == 0, "For TopIndex expected %d, got %d\n", 0, idx);
result = SendMessage(hCombo, WM_LBUTTONUP, 0, MAKELPARAM(x, y));
result = SendMessageA(hCombo, WM_LBUTTONUP, 0, MAKELPARAM(x, y));
ok(result, "WM_LBUTTONUP was not processed. LastError=%d\n",
GetLastError());
ok(GetFocus() == hCombo ||
......@@ -303,11 +301,11 @@ static void test_WM_LBUTTONDOWN(void)
GetFocus());
/* Click on the 5th item in the list */
item_height = SendMessage(hCombo, CB_GETITEMHEIGHT, 0, 0);
item_height = SendMessageA(hCombo, CB_GETITEMHEIGHT, 0, 0);
ok(GetClientRect(hList, &rect), "Failed to get list's client rect.\n");
x = rect.left + (rect.right-rect.left)/2;
y = item_height/2 + item_height*4;
result = SendMessage(hList, WM_MOUSEMOVE, 0, MAKELPARAM(x, y));
result = SendMessageA(hList, WM_MOUSEMOVE, 0, MAKELPARAM(x, y));
ok(!result, "WM_MOUSEMOVE was not processed. LastError=%d\n",
GetLastError());
ok(GetFocus() == hCombo ||
......@@ -315,17 +313,17 @@ static void test_WM_LBUTTONDOWN(void)
"Focus not on ComboBoxEx's ComboBox Control, instead on %p\n",
GetFocus());
result = SendMessage(hList, WM_LBUTTONDOWN, 0, MAKELPARAM(x, y));
result = SendMessageA(hList, WM_LBUTTONDOWN, 0, MAKELPARAM(x, y));
ok(!result, "WM_LBUTTONDOWN was not processed. LastError=%d\n",
GetLastError());
ok(GetFocus() == hCombo ||
broken(GetFocus() != hCombo), /* win98 */
"Focus not on ComboBoxEx's ComboBox Control, instead on %p\n",
GetFocus());
ok(SendMessage(hComboEx, CB_GETDROPPEDSTATE, 0, 0),
ok(SendMessageA(hComboEx, CB_GETDROPPEDSTATE, 0, 0),
"The dropdown list should still be visible.\n");
result = SendMessage(hList, WM_LBUTTONUP, 0, MAKELPARAM(x, y));
result = SendMessageA(hList, WM_LBUTTONUP, 0, MAKELPARAM(x, y));
ok(!result, "WM_LBUTTONUP was not processed. LastError=%d\n",
GetLastError());
todo_wine ok(GetFocus() == hEdit ||
......@@ -333,11 +331,11 @@ static void test_WM_LBUTTONDOWN(void)
"Focus not on ComboBoxEx's Edit Control, instead on %p\n",
GetFocus());
result = SendMessage(hCombo, CB_GETDROPPEDSTATE, 0, 0);
result = SendMessageA(hCombo, CB_GETDROPPEDSTATE, 0, 0);
ok(!result ||
broken(result != 0), /* win98 */
"The dropdown list should have been rolled up.\n");
idx = SendMessage(hComboEx, CB_GETCURSEL, 0, 0);
idx = SendMessageA(hComboEx, CB_GETCURSEL, 0, 0);
ok(idx == 4 ||
broken(idx == -1), /* win98 */
"Current Selection: expected %d, got %d\n", 4, idx);
......@@ -368,18 +366,18 @@ static void test_CB_GETLBTEXT(void)
item.iItem = 0;
item.pszText = buff;
item.cchTextMax = 1;
ret = SendMessage(hCombo, CBEM_GETITEMA, 0, (LPARAM)&item);
ret = SendMessageA(hCombo, CBEM_GETITEMA, 0, (LPARAM)&item);
ok(ret != 0, "CBEM_GETITEM failed\n");
ok(buff[0] == 0, "\n");
ret = SendMessage(hCombo, CB_GETLBTEXTLEN, 0, 0);
ret = SendMessageA(hCombo, CB_GETLBTEXTLEN, 0, 0);
ok(ret == 0, "Expected zero length\n");
ret = SendMessage(hCombo, CB_GETLBTEXTLEN, 0, 0);
ret = SendMessageA(hCombo, CB_GETLBTEXTLEN, 0, 0);
ok(ret == 0, "Expected zero length\n");
buff[0] = 'a';
ret = SendMessage(hCombo, CB_GETLBTEXT, 0, (LPARAM)buff);
ret = SendMessageA(hCombo, CB_GETLBTEXT, 0, (LPARAM)buff);
ok(ret == 0, "Expected zero length\n");
ok(buff[0] == 0, "Expected null terminator as a string, got %s\n", buff);
......@@ -533,9 +531,9 @@ static void test_comboboxex_subclass(void)
hComboEx = createComboEx(WS_BORDER | WS_VISIBLE | WS_CHILD | CBS_DROPDOWN);
hCombo = (HWND)SendMessage(hComboEx, CBEM_GETCOMBOCONTROL, 0, 0);
hCombo = (HWND)SendMessageA(hComboEx, CBEM_GETCOMBOCONTROL, 0, 0);
ok(hCombo != NULL, "Failed to get internal combo\n");
hEdit = (HWND)SendMessage(hComboEx, CBEM_GETEDITCONTROL, 0, 0);
hEdit = (HWND)SendMessageA(hComboEx, CBEM_GETEDITCONTROL, 0, 0);
ok(hEdit != NULL, "Failed to get internal edit\n");
if (pSetWindowSubclass)
......@@ -571,7 +569,7 @@ static void test_get_set_item(void)
item.mask = CBEIF_TEXT;
item.pszText = textA;
item.iItem = -1;
ret = SendMessage(hComboEx, CBEM_SETITEMA, 0, (LPARAM)&item);
ret = SendMessageA(hComboEx, CBEM_SETITEMA, 0, (LPARAM)&item);
expect(TRUE, ret);
ok_sequence(sequences, EDITBOX_SEQ_INDEX, test_setitem_edit_seq, "set item data for edit", FALSE);
......@@ -580,16 +578,16 @@ static void test_get_set_item(void)
item.mask = CBEIF_LPARAM;
item.iItem = -1;
item.lParam = 0xdeadbeef;
ret = SendMessage(hComboEx, CBEM_GETITEMA, 0, (LPARAM)&item);
ret = SendMessageA(hComboEx, CBEM_GETITEMA, 0, (LPARAM)&item);
expect(TRUE, ret);
ok(item.lParam == 0, "Expected zero, got %lx\n", item.lParam);
item.lParam = 0x1abe11ed;
ret = SendMessage(hComboEx, CBEM_SETITEMA, 0, (LPARAM)&item);
ret = SendMessageA(hComboEx, CBEM_SETITEMA, 0, (LPARAM)&item);
expect(TRUE, ret);
item.lParam = 0;
ret = SendMessage(hComboEx, CBEM_GETITEMA, 0, (LPARAM)&item);
ret = SendMessageA(hComboEx, CBEM_GETITEMA, 0, (LPARAM)&item);
expect(TRUE, ret);
ok(item.lParam == 0x1abe11ed, "Expected 0x1abe11ed, got %lx\n", item.lParam);
......
This diff is collapsed.
This diff is collapsed.
......@@ -867,7 +867,7 @@ static HBITMAP create_bitmap(INT cx, INT cy, COLORREF color, const char *comment
FillRect(hdc, &rc, hbrush);
DeleteObject(hbrush);
DrawText(hdc, comment, -1, &rc, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
DrawTextA(hdc, comment, -1, &rc, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
SelectObject(hdc, hbmp_old);
DeleteDC(hdc);
......@@ -2064,7 +2064,7 @@ START_TEST(imagelist)
ULONG_PTR ctx_cookie;
HANDLE hCtx;
HMODULE hComCtl32 = GetModuleHandle("comctl32.dll");
HMODULE hComCtl32 = GetModuleHandleA("comctl32.dll");
pImageList_Create = NULL; /* These are not needed for non-v6.0 tests*/
pImageList_Add = NULL;
pImageList_DrawIndirect = (void*)GetProcAddress(hComCtl32, "ImageList_DrawIndirect");
......
......@@ -29,9 +29,9 @@ static HWND create_ipaddress_control (void)
{
HWND handle;
handle = CreateWindowEx(0, WC_IPADDRESS, NULL,
WS_BORDER|WS_VISIBLE, 0, 0, 0, 0,
NULL, NULL, NULL, NULL);
handle = CreateWindowExA(0, WC_IPADDRESSA, NULL,
WS_BORDER|WS_VISIBLE, 0, 0, 0, 0,
NULL, NULL, NULL, NULL);
return handle;
}
......@@ -49,12 +49,12 @@ static void test_get_set_text(void)
}
/* check text just after creation */
r = GetWindowText(hwnd, ip, sizeof(ip)/sizeof(CHAR));
r = GetWindowTextA(hwnd, ip, sizeof(ip)/sizeof(CHAR));
expect(7, r);
ok(strcmp(ip, "0.0.0.0") == 0, "Expected null IP address, got %s\n", ip);
SendMessage(hwnd, IPM_SETADDRESS, 0, MAKEIPADDRESS(127, 0, 0, 1));
r = GetWindowText(hwnd, ip, sizeof(ip)/sizeof(CHAR));
SendMessageA(hwnd, IPM_SETADDRESS, 0, MAKEIPADDRESS(127, 0, 0, 1));
r = GetWindowTextA(hwnd, ip, sizeof(ip)/sizeof(CHAR));
expect(9, r);
ok(strcmp(ip, "127.0.0.1") == 0, "Expected 127.0.0.1, got %s\n", ip);
......
This diff is collapsed.
......@@ -102,8 +102,8 @@ static void test_GetPtrAW(void)
ok (count == sourcelen ||
broken(count == 0), /* win9x */
"Expected count to be %d, it was %d\n", sourcelen, count);
ok (!lstrcmp(dest, desttest) ||
broken(!lstrcmp(dest, "")), /* Win7 */
ok (!lstrcmpA(dest, desttest) ||
broken(!lstrcmpA(dest, "")), /* Win7 */
"Expected destination to not have changed\n");
count = pStr_GetPtrA(source, NULL, destsize);
......@@ -115,7 +115,7 @@ static void test_GetPtrAW(void)
ok (count == sourcelen ||
broken(count == sourcelen - 1), /* win9x */
"Expected count to be %d, it was %d\n", sourcelen, count);
ok (!lstrcmp(source, dest), "Expected source and destination to be the same\n");
ok (!lstrcmpA(source, dest), "Expected source and destination to be the same\n");
strcpy(dest, desttest);
count = pStr_GetPtrA(NULL, dest, destsize);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment