Piotr Caban : msvcp120/tests: Run _Unlink tests inside temp directory.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Feb 24 11:01:42 CST 2016


Module: wine
Branch: master
Commit: 0301c09d3e52d29f97553992e7f5b517984102e7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0301c09d3e52d29f97553992e7f5b517984102e7

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Tue Feb 23 13:13:35 2016 +0100

msvcp120/tests: Run _Unlink tests inside temp directory.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvcp120/tests/msvcp120.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/dlls/msvcp120/tests/msvcp120.c b/dlls/msvcp120/tests/msvcp120.c
index c310b89..915f58a 100644
--- a/dlls/msvcp120/tests/msvcp120.c
+++ b/dlls/msvcp120/tests/msvcp120.c
@@ -1614,6 +1614,7 @@ static void test_tr2_sys__Symlink(void)
 
 static void test_tr2_sys__Unlink(void)
 {
+    char temp_path[MAX_PATH], current_path[MAX_PATH];
     int ret, i;
     HANDLE file;
     LARGE_INTEGER file_size;
@@ -1631,6 +1632,10 @@ static void test_tr2_sys__Unlink(void)
         { NULL, ERROR_PATH_NOT_FOUND, FALSE }
     };
 
+    GetCurrentDirectoryA(MAX_PATH, current_path);
+    GetTempPathA(MAX_PATH, temp_path);
+    ok(SetCurrentDirectoryA(temp_path), "SetCurrentDirectoryA to temp_path failed\n");
+
     ret = p_tr2_sys__Make_dir("tr2_test_dir");
     ok(ret == 1, "tr2_sys__Make_dir(): expect 1 got %d\n", ret);
     file = CreateFileA("tr2_test_dir/f1", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
@@ -1664,6 +1669,8 @@ static void test_tr2_sys__Unlink(void)
     ok(!DeleteFileA("tr2_test_dir/f1_symlink"), "expect tr2_test_dir/f1_symlink not to exist\n");
     ret = p_tr2_sys__Remove_dir("tr2_test_dir");
     ok(ret == 1, "tr2_sys__Remove_dir(): expect 1 got %d\n", ret);
+
+    ok(SetCurrentDirectoryA(current_path), "SetCurrentDirectoryA failed\n");
 }
 
 static int __cdecl thrd_thread(void *arg)




More information about the wine-cvs mailing list