Commit 544c1e5c authored by Jeff Latimer's avatar Jeff Latimer Committed by Alexandre Julliard

user32/tests: Add tests for for invalid DDE conditions.

parent 70ebae34
...@@ -1372,6 +1372,53 @@ todo_wine { ...@@ -1372,6 +1372,53 @@ todo_wine {
DestroyWindow(hwnd_server); DestroyWindow(hwnd_server);
} }
static void test_initialisation(void)
{
UINT ret;
DWORD res;
HDDEDATA hdata;
HSZ server, topic, item;
DWORD client_pid;
HCONV conversation;
/* Initialise without a valid server window. */
client_pid = 0;
ret = DdeInitializeA(&client_pid, client_ddeml_callback, APPCMD_CLIENTONLY, 0);
ok(ret == DMLERR_NO_ERROR, "Expected DMLERR_NO_ERROR, got %d\n", ret);
server = DdeCreateStringHandleA(client_pid, "TestDDEService", CP_WINANSI);
topic = DdeCreateStringHandleA(client_pid, "TestDDETopic", CP_WINANSI);
DdeGetLastError(client_pid);
/* There is no server window so no conversation can be extracted */
conversation = DdeConnect(client_pid, server, topic, NULL);
ok(conversation == NULL, "Expected NULL conversation, %p\n", conversation);
ret = DdeGetLastError(client_pid);
ok(ret == DMLERR_NO_CONV_ESTABLISHED, "Expected DMLERR_NO_CONV_ESTABLISHED, got %d\n", ret);
DdeFreeStringHandle(client_pid, server);
item = DdeCreateStringHandleA(client_pid, "request", CP_WINANSI);
/* There is no converstation so an invalild parameter results */
res = 0xdeadbeef;
DdeGetLastError(client_pid);
hdata = DdeClientTransaction(NULL, 0, conversation, item, CF_TEXT, XTYP_REQUEST, default_timeout, &res);
ret = DdeGetLastError(client_pid);
todo_wine
ok(ret == DMLERR_INVALIDPARAMETER, "Expected DMLERR_INVALIDPARAMETER, got %d\n", ret);
ok(res == 0xdeadbeef, "Expected 0xdeadbeef, got %08x\n", res);
DdeFreeStringHandle(client_pid, server);
ret = DdeDisconnect(conversation);
ok(ret == FALSE, "Expected FALSE, got %d\n", ret);
ret = DdeUninitialize(client_pid);
ok(ret == TRUE, "Expected TRUE, got %d\n", ret);
}
static void test_DdeCreateStringHandleW(DWORD dde_inst, int codepage) static void test_DdeCreateStringHandleW(DWORD dde_inst, int codepage)
{ {
static const WCHAR dde_string[] = {'D','D','E',' ','S','t','r','i','n','g',0}; static const WCHAR dde_string[] = {'D','D','E',' ','S','t','r','i','n','g',0};
...@@ -2088,6 +2135,8 @@ START_TEST(dde) ...@@ -2088,6 +2135,8 @@ START_TEST(dde)
return; return;
} }
test_initialisation();
ZeroMemory(&startup, sizeof(STARTUPINFO)); ZeroMemory(&startup, sizeof(STARTUPINFO));
sprintf(buffer, "%s dde ddeml", argv[0]); sprintf(buffer, "%s dde ddeml", argv[0]);
startup.cb = sizeof(startup); startup.cb = sizeof(startup);
......
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