Commit 16f38d74 authored by Jeff Latimer's avatar Jeff Latimer Committed by Alexandre Julliard

user32/tests: Add more A and W test combinations for dde.

parent 0c5fff5e
...@@ -1176,7 +1176,6 @@ static LRESULT WINAPI dde_server_wndprocW(HWND hwnd, UINT msg, WPARAM wparam, LP ...@@ -1176,7 +1176,6 @@ static LRESULT WINAPI dde_server_wndprocW(HWND hwnd, UINT msg, WPARAM wparam, LP
ack.fBusy = 0; ack.fBusy = 0;
cmd = GlobalLock((HGLOBAL)hi); cmd = GlobalLock((HGLOBAL)hi);
if (!cmd || (lstrcmpA(cmd, exec_cmdA) && lstrcmpW((LPCWSTR)cmd, exec_cmdW))) if (!cmd || (lstrcmpA(cmd, exec_cmdA) && lstrcmpW((LPCWSTR)cmd, exec_cmdW)))
{ {
trace("ignoring unknown WM_DDE_EXECUTE command\n"); trace("ignoring unknown WM_DDE_EXECUTE command\n");
...@@ -2141,14 +2140,16 @@ static HDDEDATA CALLBACK server_end_to_end_callback(UINT uType, UINT uFmt, HCONV ...@@ -2141,14 +2140,16 @@ static HDDEDATA CALLBACK server_end_to_end_callback(UINT uType, UINT uFmt, HCONV
{ {
case XTYP_REGISTER: case XTYP_REGISTER:
{ {
ok(msg_index == 1 || msg_index == 7, "Expected 1 or 7, got %d\n", msg_index); ok(msg_index == 1 || msg_index == 7 || msg_index == 13 || msg_index == 19,
"Expected 1, 7, 13 or 19, got %d\n", msg_index);
return (HDDEDATA)TRUE; return (HDDEDATA)TRUE;
break; break;
} }
case XTYP_CONNECT: case XTYP_CONNECT:
{ {
ok(msg_index == 2 || msg_index == 8, "Expected 2 or 8, got %d\n", msg_index); ok(msg_index == 2 || msg_index == 8 || msg_index == 14 || msg_index == 20,
"Expected 2, 8, 14 or 20, got %d\n", msg_index);
ok(uFmt == 0, "Expected 0, got %d, msg_index=%d\n", uFmt, msg_index); ok(uFmt == 0, "Expected 0, got %d, msg_index=%d\n", uFmt, msg_index);
ok(hconv == 0, "Expected 0, got %p, msg_index=%d\n", hconv, msg_index); ok(hconv == 0, "Expected 0, got %p, msg_index=%d\n", hconv, msg_index);
ok(hdata == 0, "Expected 0, got %p, msg_index=%d\n", hdata, msg_index); ok(hdata == 0, "Expected 0, got %p, msg_index=%d\n", hdata, msg_index);
...@@ -2170,7 +2171,8 @@ static HDDEDATA CALLBACK server_end_to_end_callback(UINT uType, UINT uFmt, HCONV ...@@ -2170,7 +2171,8 @@ static HDDEDATA CALLBACK server_end_to_end_callback(UINT uType, UINT uFmt, HCONV
} }
case XTYP_CONNECT_CONFIRM: case XTYP_CONNECT_CONFIRM:
{ {
ok(msg_index == 3 || msg_index == 9, "Expected 3 or 9, got %d\n", msg_index); ok(msg_index == 3 || msg_index == 9 || msg_index == 15 || msg_index == 21,
"Expected 3, 9, 15 or 21 got %d\n", msg_index);
conversation = hconv; conversation = hconv;
return (HDDEDATA) TRUE; return (HDDEDATA) TRUE;
} }
...@@ -2178,8 +2180,9 @@ static HDDEDATA CALLBACK server_end_to_end_callback(UINT uType, UINT uFmt, HCONV ...@@ -2178,8 +2180,9 @@ static HDDEDATA CALLBACK server_end_to_end_callback(UINT uType, UINT uFmt, HCONV
{ {
BYTE *buffer = NULL; BYTE *buffer = NULL;
ok(msg_index == 4 || msg_index == 5 || msg_index == 10 || msg_index == 11, ok(msg_index == 4 || msg_index == 5 || msg_index == 10 || msg_index == 11 ||
"Expected 4, 5 10 or 11, got %d\n", msg_index); msg_index == 16 || msg_index == 17 || msg_index == 22 || msg_index == 23,
"Expected 4, 5, 10, 11, 16, 17, 22 or 23, got %d\n", msg_index);
ok(uFmt == 0, "Expected 0, got %d\n", uFmt); ok(uFmt == 0, "Expected 0, got %d\n", uFmt);
ok(hconv == conversation, "Expected conversation handle, got %p, msg_index=%d\n", ok(hconv == conversation, "Expected conversation handle, got %p, msg_index=%d\n",
hconv, msg_index); hconv, msg_index);
...@@ -2193,8 +2196,8 @@ static HDDEDATA CALLBACK server_end_to_end_callback(UINT uType, UINT uFmt, HCONV ...@@ -2193,8 +2196,8 @@ static HDDEDATA CALLBACK server_end_to_end_callback(UINT uType, UINT uFmt, HCONV
ok(size == 12, "Expected 12, got %d, msg_index=%d\n", size, msg_index); ok(size == 12, "Expected 12, got %d, msg_index=%d\n", size, msg_index);
size = DdeGetData(hdata, NULL, 0, 0); size = DdeGetData(hdata, NULL, 0, 0);
if (msg_index == 10 || msg_index == 11) if (msg_index == 10 || msg_index ==11 || msg_index == 16 || msg_index ==17)
if (msg_index == 10) if (msg_index == 10 || msg_index == 16)
todo_wine todo_wine
ok(size == 34, "Expected that size should be 34 not %d, msg_index=%d\n", ok(size == 34, "Expected that size should be 34 not %d, msg_index=%d\n",
size, msg_index); size, msg_index);
...@@ -2202,6 +2205,11 @@ static HDDEDATA CALLBACK server_end_to_end_callback(UINT uType, UINT uFmt, HCONV ...@@ -2202,6 +2205,11 @@ static HDDEDATA CALLBACK server_end_to_end_callback(UINT uType, UINT uFmt, HCONV
ok(size == 34, "Expected that size should be 34 not %d, msg_index=%d\n", ok(size == 34, "Expected that size should be 34 not %d, msg_index=%d\n",
size, msg_index); size, msg_index);
else else
if (msg_index ==22)
todo_wine
ok(size == 9, "Expected that size should be 9 not %d, msg_index=%d\n",
size, msg_index);
else
if (msg_index == 5) if (msg_index == 5)
todo_wine todo_wine
ok(size == 17, "Expected that size should be 17 not %d, msg_index=%d\n", ok(size == 17, "Expected that size should be 17 not %d, msg_index=%d\n",
...@@ -2211,11 +2219,11 @@ static HDDEDATA CALLBACK server_end_to_end_callback(UINT uType, UINT uFmt, HCONV ...@@ -2211,11 +2219,11 @@ static HDDEDATA CALLBACK server_end_to_end_callback(UINT uType, UINT uFmt, HCONV
size, msg_index); size, msg_index);
ok((buffer = HeapAlloc(GetProcessHeap(), 0, size)) != NULL, "should not be null\n"); ok((buffer = HeapAlloc(GetProcessHeap(), 0, size)) != NULL, "should not be null\n");
rsize = DdeGetData(hdata, buffer, size, 0); rsize = DdeGetData(hdata, buffer, size, 0);
if (msg_index == 10 || msg_index == 11) if (msg_index == 10 || msg_index == 11 || msg_index == 16 || msg_index ==17)
{ {
ok(rsize == size, "Incorrect size returned, expected %d got %d, msg_index=%d\n", ok(rsize == size, "Incorrect size returned, expected %d got %d, msg_index=%d\n",
size, rsize, msg_index); size, rsize, msg_index);
if (msg_index == 10) if (msg_index == 10 || msg_index == 16)
todo_wine { todo_wine {
ok(!lstrcmpW((WCHAR*)buffer, test_cmd_w), ok(!lstrcmpW((WCHAR*)buffer, test_cmd_w),
"Expected \"Test dde command\", msg_index=%d\n", "Expected \"Test dde command\", msg_index=%d\n",
...@@ -2228,6 +2236,10 @@ static HDDEDATA CALLBACK server_end_to_end_callback(UINT uType, UINT uFmt, HCONV ...@@ -2228,6 +2236,10 @@ static HDDEDATA CALLBACK server_end_to_end_callback(UINT uType, UINT uFmt, HCONV
msg_index); msg_index);
ok(size == 34, "Expected 34, got %d, msg_index=%d\n", size, msg_index); ok(size == 34, "Expected 34, got %d, msg_index=%d\n", size, msg_index);
} }
}else if (msg_index == 22)
{
ok(rsize == size, "Incorrect size returned, expected %d got %d, msg_index=%d\n",
size, rsize, msg_index);
} else } else
{ {
ok(rsize == size, "Incorrect size returned, expected %d got %d, msg_index=%d\n", ok(rsize == size, "Incorrect size returned, expected %d got %d, msg_index=%d\n",
...@@ -2244,6 +2256,7 @@ static HDDEDATA CALLBACK server_end_to_end_callback(UINT uType, UINT uFmt, HCONV ...@@ -2244,6 +2256,7 @@ static HDDEDATA CALLBACK server_end_to_end_callback(UINT uType, UINT uFmt, HCONV
test_cmd, buffer, msg_index); test_cmd, buffer, msg_index);
ok(size == 17, "Expected size should be 17, got %d, msg_index=%d\n", size, msg_index); ok(size == 17, "Expected size should be 17, got %d, msg_index=%d\n", size, msg_index);
} }
} }
return (HDDEDATA) DDE_FACK; return (HDDEDATA) DDE_FACK;
...@@ -2288,7 +2301,7 @@ static void test_end_to_end_client(BOOL type_a) ...@@ -2288,7 +2301,7 @@ static void test_end_to_end_client(BOOL type_a)
HCONV hconv; HCONV hconv;
HDDEDATA hdata; HDDEDATA hdata;
static char test_cmd[] = "test dde command"; static char test_cmd[] = "test dde command";
static WCHAR test_cmd_w[] = {'t','e','s','t',' ','d','d','e',' ','c','o','m','m','a','n','d',0,}; static WCHAR test_cmd_w[] = {'t','e','s','t',' ','d','d','e',' ','c','o','m','m','a','n','d',0};
static char test_service[] = "TestDDEService"; static char test_service[] = "TestDDEService";
static WCHAR test_service_w[] = {'T','e','s','t','D','D','E','S','e','r','v','i','c','e',0}; static WCHAR test_service_w[] = {'T','e','s','t','D','D','E','S','e','r','v','i','c','e',0};
static char test_topic[] = "TestDDETopic"; static char test_topic[] = "TestDDETopic";
...@@ -2436,6 +2449,18 @@ START_TEST(dde) ...@@ -2436,6 +2449,18 @@ START_TEST(dde)
test_end_to_end_server(proc.hProcess, proc.hThread, FALSE); test_end_to_end_server(proc.hProcess, proc.hThread, FALSE);
sprintf(buffer, "%s dde enda", argv[0]);
CreateProcessA(NULL, buffer, NULL, NULL, FALSE,
CREATE_SUSPENDED, NULL, NULL, &startup, &proc);
test_end_to_end_server(proc.hProcess, proc.hThread, FALSE);
sprintf(buffer, "%s dde endw", argv[0]);
CreateProcessA(NULL, buffer, NULL, NULL, FALSE,
CREATE_SUSPENDED, NULL, NULL, &startup, &proc);
test_end_to_end_server(proc.hProcess, proc.hThread, TRUE);
test_dde_aw_transaction(); test_dde_aw_transaction();
test_DdeCreateDataHandle(); test_DdeCreateDataHandle();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment