Example #1
0
/* 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;
}
Example #2
0
/* 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);
    }
}
Example #3
0
/* Delete Item Test.
 *   DDE command, expected result, and group and file name where it should exist.
 *   checks to make sure error code matches expected error code
 *   checks to make sure item does not exist if successful
 */
static void DeleteItemTest(DWORD instance, HCONV hConv, const char *command, UINT expected_result,
                           const char *fileName, const char *groupName, int testParams)
{
    HDDEDATA hData;
    UINT error;

    DdeExecuteCommand(instance, hConv, command, &hData, &error, testParams);
    todo_wine
    {
        ok (expected_result == error, "DeleteItem %s: Expected Error %s, received %s.%s\n",
            fileName, GetStringFromError(expected_result), GetStringFromError(error),
            GetStringFromTestParams(testParams));
    }

    if (error == DMLERR_NO_ERROR)
    {
        /* Check that File does not exist */
        CheckFileExistsInProgramGroups(fileName, FALSE, FALSE, groupName, testParams);
    }
}