Commit e48a5694 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

shell32/tests: Use todo_wine_if() in tests.

parent 4684dc2b
...@@ -538,10 +538,7 @@ static INT_PTR shell_execute_(const char* file, int line, LPCSTR verb, LPCSTR fi ...@@ -538,10 +538,7 @@ static INT_PTR shell_execute_(const char* file, int line, LPCSTR verb, LPCSTR fi
rc = SE_ERR_NOASSOC; rc = SE_ERR_NOASSOC;
} }
} }
if (!_todo_wait) todo_wine_if(_todo_wait)
okShell_(file, line)(wait_rc==WAIT_OBJECT_0 || rc <= 32,
"WaitForSingleObject returned %d\n", wait_rc);
else todo_wine
okShell_(file, line)(wait_rc==WAIT_OBJECT_0 || rc <= 32, okShell_(file, line)(wait_rc==WAIT_OBJECT_0 || rc <= 32,
"WaitForSingleObject returned %d\n", wait_rc); "WaitForSingleObject returned %d\n", wait_rc);
} }
...@@ -635,17 +632,12 @@ static INT_PTR shell_execute_ex_(const char* file, int line, ...@@ -635,17 +632,12 @@ static INT_PTR shell_execute_ex_(const char* file, int line,
wait_rc); wait_rc);
wait_rc = GetExitCodeProcess(sei.hProcess, &rc); wait_rc = GetExitCodeProcess(sei.hProcess, &rc);
okShell_(file, line)(wait_rc, "GetExitCodeProcess() failed le=%u\n", GetLastError()); okShell_(file, line)(wait_rc, "GetExitCodeProcess() failed le=%u\n", GetLastError());
if (!_todo_wait) todo_wine_if(_todo_wait)
okShell_(file, line)(rc == 0, "child returned %u\n", rc);
else todo_wine
okShell_(file, line)(rc == 0, "child returned %u\n", rc); okShell_(file, line)(rc == 0, "child returned %u\n", rc);
CloseHandle(sei.hProcess); CloseHandle(sei.hProcess);
} }
wait_rc=WaitForSingleObject(hEvent, 5000); wait_rc=WaitForSingleObject(hEvent, 5000);
if (!_todo_wait) todo_wine_if(_todo_wait)
okShell_(file, line)(wait_rc==WAIT_OBJECT_0,
"WaitForSingleObject returned %d\n", wait_rc);
else todo_wine
okShell_(file, line)(wait_rc==WAIT_OBJECT_0, okShell_(file, line)(wait_rc==WAIT_OBJECT_0,
"WaitForSingleObject returned %d\n", wait_rc); "WaitForSingleObject returned %d\n", wait_rc);
} }
...@@ -1318,9 +1310,7 @@ static BOOL test_one_cmdline(const cmdline_tests_t* test) ...@@ -1318,9 +1310,7 @@ static BOOL test_one_cmdline(const cmdline_tests_t* test)
count = 0; count = 0;
while (test->args[count]) while (test->args[count])
count++; count++;
if ((test->todo & 0x1) == 0) todo_wine_if(test->todo & 0x1)
ok(cl2a_count == count, "%s: expected %d arguments, but got %d\n", test->cmd, count, cl2a_count);
else todo_wine
ok(cl2a_count == count, "%s: expected %d arguments, but got %d\n", test->cmd, count, cl2a_count); ok(cl2a_count == count, "%s: expected %d arguments, but got %d\n", test->cmd, count, cl2a_count);
for (i = 0; i < cl2a_count; i++) for (i = 0; i < cl2a_count; i++)
...@@ -1328,14 +1318,10 @@ static BOOL test_one_cmdline(const cmdline_tests_t* test) ...@@ -1328,14 +1318,10 @@ static BOOL test_one_cmdline(const cmdline_tests_t* test)
if (i < count) if (i < count)
{ {
MultiByteToWideChar(CP_ACP, 0, test->args[i], -1, argW, sizeof(argW)/sizeof(*argW)); MultiByteToWideChar(CP_ACP, 0, test->args[i], -1, argW, sizeof(argW)/sizeof(*argW));
if ((test->todo & (1 << (i+4))) == 0) todo_wine_if(test->todo & (1 << (i+4)))
ok(!lstrcmpW(*argsW, argW), "%s: arg[%d] expected %s but got %s\n", test->cmd, i, wine_dbgstr_w(argW), wine_dbgstr_w(*argsW));
else todo_wine
ok(!lstrcmpW(*argsW, argW), "%s: arg[%d] expected %s but got %s\n", test->cmd, i, wine_dbgstr_w(argW), wine_dbgstr_w(*argsW)); ok(!lstrcmpW(*argsW, argW), "%s: arg[%d] expected %s but got %s\n", test->cmd, i, wine_dbgstr_w(argW), wine_dbgstr_w(*argsW));
} }
else if ((test->todo & 0x1) == 0) else todo_wine_if(test->todo & 0x1)
ok(0, "%s: got extra arg[%d]=%s\n", test->cmd, i, wine_dbgstr_w(*argsW));
else todo_wine
ok(0, "%s: got extra arg[%d]=%s\n", test->cmd, i, wine_dbgstr_w(*argsW)); ok(0, "%s: got extra arg[%d]=%s\n", test->cmd, i, wine_dbgstr_w(*argsW));
argsW++; argsW++;
} }
...@@ -1605,12 +1591,10 @@ static void test_argify(void) ...@@ -1605,12 +1591,10 @@ static void test_argify(void)
count = 0; count = 0;
while (test->cmd.args[count]) while (test->cmd.args[count])
count++; count++;
if ((test->todo & 0x1) == 0)
/* +4 for the shlexec arguments, -1 because of the added "" /* +4 for the shlexec arguments, -1 because of the added ""
* argument for the CommandLineToArgvW() tests. * argument for the CommandLineToArgvW() tests.
*/ */
okChildInt("argcA", 4 + count - 1); todo_wine_if(test->todo & 0x1)
else todo_wine
okChildInt("argcA", 4 + count - 1); okChildInt("argcA", 4 + count - 1);
cmd = getChildString("Child", "cmdlineA"); cmd = getChildString("Child", "cmdlineA");
...@@ -1620,10 +1604,7 @@ static void test_argify(void) ...@@ -1620,10 +1604,7 @@ static void test_argify(void)
if (cmd) cmd = strstr(cmd, test->verb); if (cmd) cmd = strstr(cmd, test->verb);
if (cmd) cmd += strlen(test->verb); if (cmd) cmd += strlen(test->verb);
if (!cmd) cmd = "(null)"; if (!cmd) cmd = "(null)";
if ((test->todo & 0x2) == 0) todo_wine_if(test->todo & 0x2)
okShell(!strcmp(cmd, test->cmd.cmd) || broken(!strcmp(cmd, bad->cmd)),
"the cmdline is '%s' instead of '%s'\n", cmd, test->cmd.cmd);
else todo_wine
okShell(!strcmp(cmd, test->cmd.cmd) || broken(!strcmp(cmd, bad->cmd)), okShell(!strcmp(cmd, test->cmd.cmd) || broken(!strcmp(cmd, bad->cmd)),
"the cmdline is '%s' instead of '%s'\n", cmd, test->cmd.cmd); "the cmdline is '%s' instead of '%s'\n", cmd, test->cmd.cmd);
...@@ -1631,9 +1612,7 @@ static void test_argify(void) ...@@ -1631,9 +1612,7 @@ static void test_argify(void)
{ {
char argname[18]; char argname[18];
sprintf(argname, "argvA%d", 4 + i); sprintf(argname, "argvA%d", 4 + i);
if ((test->todo & (1 << (i+4))) == 0) todo_wine_if(test->todo & (1 << (i+4)))
okChildStringBroken(argname, test->cmd.args[i+1], bad->args[i+1]);
else todo_wine
okChildStringBroken(argname, test->cmd.args[i+1], bad->args[i+1]); okChildStringBroken(argname, test->cmd.args[i+1], bad->args[i+1]);
} }
...@@ -1699,32 +1678,14 @@ static void test_filename(void) ...@@ -1699,32 +1678,14 @@ static void test_filename(void)
if (rc == 33) if (rc == 33)
{ {
const char* verb; const char* verb;
if ((test->todo & 0x2)==0) todo_wine_if(test->todo & 0x2)
{
okChildInt("argcA", 5);
}
else todo_wine
{
okChildInt("argcA", 5); okChildInt("argcA", 5);
}
verb=(test->verb ? test->verb : "Open"); verb=(test->verb ? test->verb : "Open");
if ((test->todo & 0x4)==0) todo_wine_if(test->todo & 0x4)
{
okChildString("argvA3", verb); okChildString("argvA3", verb);
} todo_wine_if(test->todo & 0x8)
else todo_wine
{
okChildString("argvA3", verb);
}
if ((test->todo & 0x8)==0)
{
okChildPath("argvA4", filename);
}
else todo_wine
{
okChildPath("argvA4", filename); okChildPath("argvA4", filename);
} }
}
test++; test++;
} }
...@@ -1735,14 +1696,8 @@ static void test_filename(void) ...@@ -1735,14 +1696,8 @@ static void test_filename(void)
rc=shell_execute(test->verb, filename, NULL, NULL); rc=shell_execute(test->verb, filename, NULL, NULL);
if (rc > 32) if (rc > 32)
rc=33; rc=33;
if ((test->todo & 0x1)==0) todo_wine_if(test->todo & 0x1)
{
okShell(rc==test->rc, "failed: rc=%ld err=%u\n", rc, GetLastError());
}
else todo_wine
{
okShell(rc==test->rc, "failed: rc=%ld err=%u\n", rc, GetLastError()); okShell(rc==test->rc, "failed: rc=%ld err=%u\n", rc, GetLastError());
}
if (rc==0) if (rc==0)
{ {
int count; int count;
...@@ -1750,14 +1705,8 @@ static void test_filename(void) ...@@ -1750,14 +1705,8 @@ static void test_filename(void)
char* str; char* str;
verb=(test->verb ? test->verb : "Open"); verb=(test->verb ? test->verb : "Open");
if ((test->todo & 0x4)==0) todo_wine_if(test->todo & 0x4)
{
okChildString("argvA3", verb);
}
else todo_wine
{
okChildString("argvA3", verb); okChildString("argvA3", verb);
}
count=4; count=4;
str=filename; str=filename;
...@@ -1769,28 +1718,16 @@ static void test_filename(void) ...@@ -1769,28 +1718,16 @@ static void test_filename(void)
if (space) if (space)
*space='\0'; *space='\0';
sprintf(attrib, "argvA%d", count); sprintf(attrib, "argvA%d", count);
if ((test->todo & 0x8)==0) todo_wine_if(test->todo & 0x8)
{
okChildPath(attrib, str);
}
else todo_wine
{
okChildPath(attrib, str); okChildPath(attrib, str);
}
count++; count++;
if (!space) if (!space)
break; break;
str=space+1; str=space+1;
} }
if ((test->todo & 0x2)==0) todo_wine_if(test->todo & 0x2)
{
okChildInt("argcA", count);
}
else todo_wine
{
okChildInt("argcA", count); okChildInt("argcA", count);
} }
}
test++; test++;
} }
...@@ -1915,37 +1852,23 @@ static void test_fileurls(void) ...@@ -1915,37 +1852,23 @@ static void test_fileurls(void)
} }
if (test->flags & URL_SUCCESS) if (test->flags & URL_SUCCESS)
{ {
if ((test->todo & 0x1) == 0) todo_wine_if(test->todo & 0x1)
okShell(rc > 32, "failed: bad rc=%lu\n", rc);
else todo_wine
okShell(rc > 32, "failed: bad rc=%lu\n", rc); okShell(rc > 32, "failed: bad rc=%lu\n", rc);
} }
else else
{ {
if ((test->todo & 0x1) == 0) todo_wine_if(test->todo & 0x1)
okShell(rc == SE_ERR_FNF || rc == SE_ERR_PNF ||
broken(rc == SE_ERR_ACCESSDENIED) /* win2000 */,
"failed: bad rc=%lu\n", rc);
else todo_wine
okShell(rc == SE_ERR_FNF || rc == SE_ERR_PNF || okShell(rc == SE_ERR_FNF || rc == SE_ERR_PNF ||
broken(rc == SE_ERR_ACCESSDENIED) /* win2000 */, broken(rc == SE_ERR_ACCESSDENIED) /* win2000 */,
"failed: bad rc=%lu\n", rc); "failed: bad rc=%lu\n", rc);
} }
if (rc == 33) if (rc == 33)
{ {
if ((test->todo & 0x2) == 0) todo_wine_if(test->todo & 0x2)
okChildInt("argcA", 5); okChildInt("argcA", 5);
else todo_wine todo_wine_if(test->todo & 0x4)
okChildInt("argcA", 5);
if ((test->todo & 0x4) == 0)
okChildString("argvA3", "Open");
else todo_wine
okChildString("argvA3", "Open"); okChildString("argvA3", "Open");
todo_wine_if(test->todo & 0x8)
if ((test->todo & 0x8) == 0)
okChildPath("argvA4", filename);
else todo_wine
okChildPath("argvA4", filename); okChildPath("argvA4", filename);
} }
test++; test++;
...@@ -2068,31 +1991,18 @@ static void test_find_executable(void) ...@@ -2068,31 +1991,18 @@ static void test_find_executable(void)
rc=(INT_PTR)FindExecutableA(filename, NULL, command); rc=(INT_PTR)FindExecutableA(filename, NULL, command);
if (rc > 32) if (rc > 32)
rc=33; rc=33;
if ((test->todo & 0x10)==0) todo_wine_if(test->todo & 0x10)
{
ok(rc==test->rc, "FindExecutable(%s) failed: rc=%ld\n", filename, rc);
}
else todo_wine
{
ok(rc==test->rc, "FindExecutable(%s) failed: rc=%ld\n", filename, rc); ok(rc==test->rc, "FindExecutable(%s) failed: rc=%ld\n", filename, rc);
}
if (rc > 32) if (rc > 32)
{ {
BOOL equal; BOOL equal;
equal=strcmp(command, argv0) == 0 || equal=strcmp(command, argv0) == 0 ||
/* NT4 returns an extra 0x8 character! */ /* NT4 returns an extra 0x8 character! */
(strlen(command) == strlen(argv0)+1 && strncmp(command, argv0, strlen(argv0)) == 0); (strlen(command) == strlen(argv0)+1 && strncmp(command, argv0, strlen(argv0)) == 0);
if ((test->todo & 0x20)==0) todo_wine_if(test->todo & 0x20)
{
ok(equal, "FindExecutable(%s) returned command='%s' instead of '%s'\n",
filename, command, argv0);
}
else todo_wine
{
ok(equal, "FindExecutable(%s) returned command='%s' instead of '%s'\n", ok(equal, "FindExecutable(%s) returned command='%s' instead of '%s'\n",
filename, command, argv0); filename, command, argv0);
} }
}
test++; test++;
} }
} }
...@@ -2192,32 +2102,14 @@ static void test_lnks(void) ...@@ -2192,32 +2102,14 @@ static void test_lnks(void)
NULL, NULL); NULL, NULL);
if (rc > 32) if (rc > 32)
rc=33; rc=33;
if ((test->todo & 0x1)==0) todo_wine_if(test->todo & 0x1)
{
okShell(rc==test->rc, "failed: rc=%lu err=%u\n", rc, GetLastError());
}
else todo_wine
{
okShell(rc==test->rc, "failed: rc=%lu err=%u\n", rc, GetLastError()); okShell(rc==test->rc, "failed: rc=%lu err=%u\n", rc, GetLastError());
}
if (rc==0) if (rc==0)
{ {
if ((test->todo & 0x2)==0) todo_wine_if(test->todo & 0x2)
{
okChildInt("argcA", 5);
}
else
{
okChildInt("argcA", 5); okChildInt("argcA", 5);
} todo_wine_if(test->todo & 0x4)
if ((test->todo & 0x4)==0)
{
okChildString("argvA3", "Lnk");
}
else todo_wine
{
okChildString("argvA3", "Lnk"); okChildString("argvA3", "Lnk");
}
sprintf(params, test->basename, tmpdir); sprintf(params, test->basename, tmpdir);
okChildPath("argvA4", params); okChildPath("argvA4", params);
} }
...@@ -2640,31 +2532,16 @@ static void test_dde_default_app(void) ...@@ -2640,31 +2532,16 @@ static void test_dde_default_app(void)
} }
} }
if ((test->todo & 0x1)==0) todo_wine_if(test->todo & 0x1)
{
okShell(rc==test->rc[which], "failed: rc=%lu err=%u\n", okShell(rc==test->rc[which], "failed: rc=%lu err=%u\n",
rc, GetLastError()); rc, GetLastError());
}
else todo_wine
{
okShell(rc==test->rc[which], "failed: rc=%lu err=%u\n",
rc, GetLastError());
}
if (rc == 33) if (rc == 33)
{ {
if ((test->todo & 0x2)==0) todo_wine_if(test->todo & 0x2)
{
ok(!strcmp(ddeApplication, test->expectedDdeApplication[which]), ok(!strcmp(ddeApplication, test->expectedDdeApplication[which]),
"Expected application '%s', got '%s'\n", "Expected application '%s', got '%s'\n",
test->expectedDdeApplication[which], ddeApplication); test->expectedDdeApplication[which], ddeApplication);
} }
else todo_wine
{
ok(!strcmp(ddeApplication, test->expectedDdeApplication[which]),
"Expected application '%s', got '%s'\n",
test->expectedDdeApplication[which], ddeApplication);
}
}
reset_association_description(); reset_association_description();
delete_test_association(".sde"); delete_test_association(".sde");
......
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