advapi32/tests: Change the current directory to a place that will be writable.
Alexandre Julliard
julliard at winehq.org
Tue Mar 4 12:23:12 CST 2014
Francois Gouget <fgouget at free.fr> writes:
> ---
> dlls/advapi32/tests/eventlog.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/dlls/advapi32/tests/eventlog.c b/dlls/advapi32/tests/eventlog.c
> index f71529c..525d606 100644
> --- a/dlls/advapi32/tests/eventlog.c
> +++ b/dlls/advapi32/tests/eventlog.c
> @@ -1123,6 +1123,8 @@ static void cleanup_eventlog(void)
>
> START_TEST(eventlog)
> {
> + char curdir[MAX_PATH], tmpdir[MAX_PATH];
> +
> SetLastError(0xdeadbeef);
> CloseEventLog(NULL);
> if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
> @@ -1131,6 +1133,10 @@ START_TEST(eventlog)
> return;
> }
>
> + GetCurrentDirectoryA(MAX_PATH, curdir);
> + GetTempPathA(MAX_PATH, tmpdir);
> + SetCurrentDirectoryA(tmpdir);
> +
A better fix would be to build proper temp file names with
GetTempPath+GetTempFileName instead of using hardcoded paths in file
creation calls.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list