Commit 5af9c123 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

shell32/tests: Allow the short and long forms when checking a ShellExecute() path.

ShellExecute() sometimes converts a short path to a long one so always accept the long form. Windows XP SP1 often converts them to short paths instead but consider this behavior to be broken. Signed-off-by: 's avatarFrancois Gouget <fgouget@free.fr> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent bfc12443
......@@ -425,13 +425,29 @@ static int StrCmpPath(const char* s1, const char* s2)
static void okChildPath_(const char* file, int line, const char* key, const char* expected)
{
char* result;
int equal, shortequal;
result=getChildString("Child", key);
if (!result)
{
okShell_(file,line)(FALSE, "%s expected '%s', but key not found or empty\n", key, expected);
return;
}
okShell_(file,line)(StrCmpPath(result, expected) == 0,
shortequal = FALSE;
equal = (StrCmpPath(result, expected) == 0);
if (!equal)
{
char altpath[MAX_PATH];
DWORD rc = GetLongPathNameA(expected, altpath, sizeof(altpath));
if (0 < rc && rc < sizeof(altpath))
equal = (StrCmpPath(result, altpath) == 0);
if (!equal)
{
rc = GetShortPathNameA(expected, altpath, sizeof(altpath));
if (0 < rc && rc < sizeof(altpath))
shortequal = (StrCmpPath(result, altpath) == 0);
}
}
okShell_(file,line)(equal || broken(shortequal) /* XP SP1 */,
"%s expected '%s', got '%s'\n", key, expected, result);
}
#define okChildPath(key, expected) okChildPath_(__FILE__, __LINE__, (key), (expected))
......
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