user32/tests: Add tests for for invalid DDE conditions.
This commit is contained in:
parent
70ebae341d
commit
544c1e5cd1
|
@ -1372,6 +1372,53 @@ todo_wine {
|
|||
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 const WCHAR dde_string[] = {'D','D','E',' ','S','t','r','i','n','g',0};
|
||||
|
@ -2088,6 +2135,8 @@ START_TEST(dde)
|
|||
return;
|
||||
}
|
||||
|
||||
test_initialisation();
|
||||
|
||||
ZeroMemory(&startup, sizeof(STARTUPINFO));
|
||||
sprintf(buffer, "%s dde ddeml", argv[0]);
|
||||
startup.cb = sizeof(startup);
|
||||
|
|
Loading…
Reference in New Issue