Alexandre Julliard : kernel32/tests: Use GetTempFileName() instead of hardcoding directory names.
Alexandre Julliard
julliard at winehq.org
Thu Feb 28 16:09:44 CST 2019
Module: wine
Branch: master
Commit: c525d7ab98d558a158613903e797f93ce2979748
URL: https://source.winehq.org/git/wine.git/?a=commit;h=c525d7ab98d558a158613903e797f93ce2979748
Author: Alexandre Julliard <julliard at winehq.org>
Date: Thu Feb 28 21:24:51 2019 +0100
kernel32/tests: Use GetTempFileName() instead of hardcoding directory names.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/kernel32/tests/change.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/dlls/kernel32/tests/change.c b/dlls/kernel32/tests/change.c
index 3c8084d..254faf9 100644
--- a/dlls/kernel32/tests/change.c
+++ b/dlls/kernel32/tests/change.c
@@ -118,10 +118,12 @@ static void test_FindFirstChangeNotification(void)
ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "FindCloseChangeNotification error: %d\n",
GetLastError());
- ret = GetTempPathA(MAX_PATH, workdir);
+ ret = GetTempPathA(MAX_PATH, dirname1);
ok(ret, "GetTempPathA error: %d\n", GetLastError());
- lstrcatA(workdir, "testFileChangeNotification");
+ ret = GetTempFileNameA(dirname1, "ffc", 0, workdir);
+ ok(ret, "GetTempFileNameA error: %d\n", GetLastError());
+ DeleteFileA( workdir );
ret = CreateDirectoryA(workdir, NULL);
ok(ret, "CreateDirectoryA error: %d\n", GetLastError());
@@ -370,14 +372,14 @@ static void test_ffcnMultipleThreads(void)
LONG r;
DWORD filter, threadId, status, exitcode;
HANDLE handles[2];
- char path[MAX_PATH];
+ char tmp[MAX_PATH], path[MAX_PATH];
- r = GetTempPathA(MAX_PATH, path);
+ r = GetTempPathA(MAX_PATH, tmp);
ok(r, "GetTempPathA error: %d\n", GetLastError());
- lstrcatA(path, "ffcnTestMultipleThreads");
-
- RemoveDirectoryA(path);
+ r = GetTempFileNameA(tmp, "ffc", 0, path);
+ ok(r, "GetTempFileNameA error: %d\n", GetLastError());
+ DeleteFileA( path );
r = CreateDirectoryA(path, NULL);
ok(r, "CreateDirectoryA error: %d\n", GetLastError());
More information about the wine-cvs
mailing list