/* Create Group Test. * command and expected_result. * if expected_result is DMLERR_NO_ERROR, test * 1. group was created * 2. window is open */ static void CreateGroupTest(DWORD instance, HCONV hConv, const char *command, UINT expected_result, const char *groupName, const char *windowTitle, int testParams) { HDDEDATA hData; UINT error; /* Execute Command & Check Result */ DdeExecuteCommand(instance, hConv, command, &hData, &error, testParams); todo_wine { ok (expected_result == error, "CreateGroup %s: Expected Error %s, received %s.%s\n", groupName, GetStringFromError(expected_result), GetStringFromError(error), GetStringFromTestParams(testParams)); } /* No Error */ if (error == DMLERR_NO_ERROR) { /* Check if Group Now Exists */ CheckFileExistsInProgramGroups(groupName, TRUE, TRUE, NULL, testParams); /* Check if Window is Open (polling) */ CheckWindowCreated(windowTitle, TRUE, testParams); } }
/* Show Group Test. * DDE command, expected_result, and the group name to check for existence * if expected_result is DMLERR_NO_ERROR, test * 1. window is open */ static void ShowGroupTest(DWORD instance, HCONV hConv, const char *command, UINT expected_result, const char *groupName, const char *windowTitle, int closeAfterShowing, int testParams) { HDDEDATA hData; UINT error; DdeExecuteCommand(instance, hConv, command, &hData, &error, testParams); /* todo_wine... Is expected to fail, wine stubbed functions DO fail */ /* TODO REMOVE THIS CODE!!! */ if (expected_result == DMLERR_NOTPROCESSED) { ok (expected_result == error, "ShowGroup %s: Expected Error %s, received %s.%s\n", groupName, GetStringFromError(expected_result), GetStringFromError(error), GetStringFromTestParams(testParams)); } else { todo_wine { ok (expected_result == error, "ShowGroup %s: Expected Error %s, received %s.%s\n", groupName, GetStringFromError(expected_result), GetStringFromError(error), GetStringFromTestParams(testParams)); } } if (error == DMLERR_NO_ERROR) { /* Check if Window is Open (polling) */ CheckWindowCreated(windowTitle, closeAfterShowing, testParams); } }
/* Compound Command Test. * not really generic, assumes command of the form: * [CreateGroup ...][AddItem ...][AddItem ...] * All samples I've seen using Compound were of this form (CreateGroup, * AddItems) so this covers minimum expected functionality. */ static HWND CompoundCommandTest(DWORD instance, HCONV hConv, const char *command, UINT expected_result, const char *groupName, const char *windowTitle, const char *fileName1, const char *fileName2, int testParams) { HDDEDATA hData; UINT error; HWND hwnd = 0; DdeExecuteCommand(instance, hConv, command, &hData, &error, testParams); todo_wine { ok (expected_result == error, "Compound String %s: Expected Error %s, received %s.%s\n", command, GetStringFromError(expected_result), GetStringFromError(error), GetStringFromTestParams(testParams)); } if (error == DMLERR_NO_ERROR) { /* Check that File exists */ CheckFileExistsInProgramGroups(groupName, TRUE, TRUE, NULL, testParams); hwnd = CheckWindowCreated(windowTitle, FALSE, testParams); CheckFileExistsInProgramGroups(fileName1, TRUE, FALSE, groupName, testParams); CheckFileExistsInProgramGroups(fileName2, TRUE, FALSE, groupName, testParams); } return hwnd; }