Commit Graph

160 Commits

Author SHA1 Message Date
Francois Gouget fd7e5741ae shell32/tests: Fix the temporary directory creation in shlexec.
Since the test no longer uses a random directory name, the directory is
more likely to exist already. So use it even if it already exists.
Also on some Windows versions (e.g. Windos 2008) GetLongPathName() does
not return the long name if the path does not exist. So do the
conversion before appending the new directory name.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-27 21:16:13 +01:00
Damjan Jovanovic 9736fe499d shell32: Pass the executable's full path from SHELL_execute() to CreateProcess().
Several older Microsoft installers, particularly those changing CDs
during installation, break because they launch a child setup.exe, from
a parent process also called setup.exe, which Wine finds in the wrong
directory, as CreateProcess() first searches the parent executable's
own directory, thus re-launching the parent itself instead of the
child.  Therefore CreateProcess() must be passed a full path from
SHELL_execute(), so it launches the correct child.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=8439
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-23 11:35:46 +01:00
Damjan Jovanovic fe83877cb3 shell32/tests: Test shlexec argv[0], and same-named executables in a different directory.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=8439
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-23 11:35:40 +01:00
Damjan Jovanovic 971e7e22e0 shell32/tests: Tmpdir shouldn't end with a backslash.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-23 11:35:32 +01:00
Francois Gouget 30f84ef51e shell32/tests: Don't use randomized paths in the shlexec test.
In case of a failure it is necessary to show the path that was passed
to ShellExecute(). That means the paths must not be randomized so as
not to prevent the TestBot from detecting new failures.
Note that because of the registry modifications one cannot run two
instances of the test concurrently anyway.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-19 13:05:30 +01:00
Serge Gautherie 8fc0b7d525 shell32/tests: Remove now useless forced 0x0501 API versions.
Signed-off-by: Serge Gautherie <winehq-git_serge_180711@gautherie.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-17 10:27:21 +01:00
Francois Gouget 1ac9bf9e45 shell32/tests: Fix some wording issues in shlexec comments.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-17 09:43:35 +01:00
Rémi Bernon d1373e8aae shell32/tests: Fix some format-overflow warnings.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-11 22:39:59 +01:00
Alexandre Julliard 4429b9f803 advapi32/tests: Use debug.h functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-17 16:55:16 +01:00
Alexandre Julliard d4ef782db7 makefiles: Build all tests with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-24 12:10:51 +02:00
Alexandre Julliard 1459a0105d makefiles: Default to building test modules as PE.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-09 15:45:59 +02:00
Alistair Leslie-Hughes cce8398dea shell32: Properly fail when a data object cannot be created.
Based on a patch by Mark Jansen.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-16 14:04:24 +02:00
Mark Jansen f7d47b4951 shell32: Expand environment strings in ShellExecute.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-16 14:04:22 +02:00
Zebediah Figura b79eff8d91 shell32/tests: Don't test CommandLineToArgv() in test_argify().
This is essentially redundant. We should have tests for all behaviours of
CommandLineToArgv() above; the purpose of test_argify() is to test how
ShellExecute() et al. parses its parameters, and to show that this is
different from CommandLineToArgv().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-22 01:01:55 +02:00
Michael Stefaniuc c57b9b8d9f shell32/tests: Use the available ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-15 12:56:48 +02:00
Nikolay Sivov a6ad34f855 shell32/tests: Use the global memory allocation helpers.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-20 20:13:02 +01:00
Francois Gouget 15d9a4a711 shell32/tests: Fix a race condition in the DDE ShellExecute() tests on Windows 10.
Even if we have a results file after a failed ShellExecuteEx() call, it
may not correspond to the last call and should thus be ignored.

Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-04-12 12:03:57 +09:00
Francois Gouget d02e559b91 shell32/tests: Make shlexec's reset_association_description() static.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-22 22:23:42 +09:00
Francois Gouget 822e78ee04 shell32/tests: Test default verb detection for files as well as for URLs.
When Internet Explorer 6 is installer, Windows XP detects non-standard
verbs just fine for files but not for URLs.

Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-22 00:36:27 +09:00
Francois Gouget e7065e0c51 shell32/tests: Move a file URL test to test_fileurl().
This way it's integrated with the rest of the matching tests and skipped
on plaforms where file URLs don't work right (old Windows XP versions).

Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-22 00:36:27 +09:00
Francois Gouget 11d77e51d5 shell32/tests: Delete the shlproto test class when done.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-22 00:36:27 +09:00
Francois Gouget 6e9c7adcee shell32/tests: Test ShellExecute()'s URL handling.
Also tweak the class creation functions and add create_test_class() so
one can create a class without associating it with an extension.

Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-22 17:37:11 +09:00
Francois Gouget c8bc68ecb4 shell32/tests: Take into account the Windows 10 DDE race condition.
Also improve the description of this race condition.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-16 12:09:39 +09:00
Francois Gouget e48a569434 shell32/tests: Use todo_wine_if() in tests.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-16 12:09:39 +09:00
Francois Gouget 43fe3574f4 shell32/tests: Fix an ok() call so it shows which DDE test caused the failure.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-14 12:39:44 +09:00
Francois Gouget 5af9c123f6 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: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-08 20:03:33 +09:00
Francois Gouget bfc1244381 shell32/tests: Fix the ShellExecute() environment variable inheritance checks.
The child process does not inherit environment variables when the
calling process does not have elevated privileges and specifies
SEE_MASK_NOZONECHECKS.

Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-08 20:03:33 +09:00
Francois Gouget c1636cd279 shell32/tests: Move a test_argify() check so it is run even if we could not create associations.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-08 20:03:33 +09:00
Francois Gouget 96baeb72c2 shell32/tests: Skip a few ShellExecute() tests when the process has insufficient privileges.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-08 20:03:33 +09:00
Francois Gouget 13fdfedead shell32/tests: Remove support for a todo_wine flag in ShellExecute()'s test_lnks() loop.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-08 20:03:33 +09:00
Francois Gouget f4130de33e shell32/tests: Fix a ShellExecute() race condition.
On Windows XP SP1 a ShellExecute() call that is supposed to fail
succeeds instead. This means the child process is started but
ShellExecute() returns without waiting for it, resulting in a race
condition on the child's results file. So use our shell_execute_ex()
wrapper instead as it always waits for the child process.

Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-08 20:03:33 +09:00
Francois Gouget cc240bdb14 shell32/tests: Fix test_dde_default_app() on Windows XP SP1.
There are three possible sets of results: Windows <= 2000, XP SP1 and >= XP SP2.
Use the first two tests to figure out which results to expect.
Only accept the >= XP SP2 results in Wine.

Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-08 20:03:32 +09:00
Francois Gouget b742145cab shell32/tests: Fix the DDE tests on Windows 10.
Windows 10 does not call WaitForInputIdle() if the DDE server is a
console application. So force the call by adding
SEE_MASK_WAITFORINPUTIDLE.  Also Windows calls WaitForInputIdle() with a
60s timeout and while we should not hit it, trace and cap it to 5s
anyway.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-08 20:03:32 +09:00
Francois Gouget a090eff243 shell32/tests: Fix okShell()'s tracing so it takes todo and other flags into account.
This also causes the ShellExecute() and association descriptions to be
printed with each failing test. This makes the messages more readable in
TestBot's abbreviated logs, at the cost of a lot more redundancy.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-08 13:46:02 +09:00
Francois Gouget 805b5e36a9 shell32/tests: Add server-side DDE checks.
Should something go wrong a failed ok() call will leave a clearer trace
in the log than an assert.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-29 21:25:20 +09:00
Francois Gouget 446ade3b3c shell32/tests: Test environment variable inheritance with ShellExecute().
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-29 21:25:20 +09:00
Francois Gouget bdfaa8c807 shell32/tests: Check for failures in the child process.
Return the number of failures through both the child result file and the process exit code.
Also rename the child result file section to 'Child' since it no longer only contains 'Arguments'.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-29 21:25:19 +09:00
Francois Gouget 30230fae5f shell32/tests: Check the child process exit code and close the process handle.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-29 21:25:19 +09:00
Francois Gouget 3a9b09aa7d shell32/tests: Declare childPrintf() as a printf-style function.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-29 21:25:18 +09:00
Francois Gouget 38ad0ee01d shell32/tests: Reorder the functions to avoid forward declarations.
This also groups the helpers in a more logical fashion.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-29 21:25:18 +09:00
Francois Gouget 759bd96ac2 shell32/tests: Add traces to the WaitForInputIdle() hooking process.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-29 21:25:17 +09:00
Francois Gouget 78ada2e154 shell32/tests: Fix a couple of okChildPath()/okChildString() mixups.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-28 15:51:07 +09:00
Francois Gouget 3079179753 shell32/tests: Show that verbs and classes override ShellExecute()'s normal handling of executables.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-28 15:51:04 +09:00
Francois Gouget 2c0daad786 shell32/tests: Test handling of nonexistent verbs in ShellExecute() & co.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-28 15:51:00 +09:00
Francois Gouget 198e0d5d78 shell32/tests: Trace the association properties for the DDE tests.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-26 23:17:57 +09:00
Francois Gouget 7e000abeda shell32/tests: Call okShell() after a shell_execute{_ex}() test.
This ensures all the failed call parameters will be traced.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-26 23:17:24 +09:00
Francois Gouget c133ef7326 shell32/tests: Trace the last ShellExecute command whenever a corresponding test fails.
okShell() serves to encapsulate handling of shell_call and also provides a means for further extensions.

Remove the shell_call static initialization to not hide potential
use-before-assignment compiler warnings.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-26 23:17:05 +09:00
Francois Gouget 09dac2f482 shell32/tests: Use the shell_execute{_ex}() call site for its traces and error messages.
This makes it easier to match their internal test failures with the site of the real test.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-19 21:44:15 +09:00
Francois Gouget 9cc07a2b31 shell32/tests: Trace the effective ShellExecuteEx() flags.
shell_execute_ex() adds some flags for its own internal needs. The
traces should reflect that.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-13 23:47:04 +09:00
Francois Gouget f816bc93b0 shell32/tests: Tweak some overly optimistic ok() messages.
ShellExecute() is more likely to have returned an unexpected error code
than it is to have succeeded.

Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-13 23:46:53 +09:00