Reece Dunn : shell32: Do not use a fixed path in the shelllink tests.

Alexandre Julliard julliard at winehq.org
Mon Jul 21 08:52:10 CDT 2008


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

Author: Reece Dunn <msclrhd at googlemail.com>
Date:   Sun Jul 20 14:40:19 2008 +0100

shell32: Do not use a fixed path in the shelllink tests.

---

 dlls/shell32/tests/shelllink.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c
index 5b905b4..44e314d 100644
--- a/dlls/shell32/tests/shelllink.c
+++ b/dlls/shell32/tests/shelllink.c
@@ -49,7 +49,6 @@ static const GUID _IID_IShellLinkDataList = {
     { 0xb9, 0x2f, 0x00, 0xa0, 0xc9, 0x03, 0x12, 0xe1 }
 };
 
-static const WCHAR lnkfile[]= { 'C',':','\\','t','e','s','t','.','l','n','k',0 };
 static const WCHAR notafile[]= { 'C',':','\\','n','o','n','e','x','i','s','t','e','n','t','\\','f','i','l','e',0 };
 
 
@@ -494,6 +493,12 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo)
 
 static void test_load_save(void)
 {
+    WCHAR lnkfile[MAX_PATH];
+    static const WCHAR lnkfile_name[] = { '\\', 't', 'e', 's', 't', '.', 'l', 'n', 'k', '\0' };
+
+    char lnkfileA[MAX_PATH];
+    static const char lnkfileA_name[] = "\\test.lnk";
+
     lnk_desc_t desc;
     char mypath[MAX_PATH];
     char mydir[MAX_PATH];
@@ -508,6 +513,12 @@ static void test_load_save(void)
         return;
     }
 
+    /* Don't used a fixed path for the test.lnk file */
+    GetTempPathW(MAX_PATH, lnkfile);
+    lstrcatW(lnkfile, lnkfile_name);
+    GetTempPathA(MAX_PATH, lnkfileA);
+    lstrcatA(lnkfileA, lnkfileA_name);
+
     /* Save an empty .lnk file */
     memset(&desc, 0, sizeof(desc));
     create_lnk(lnkfile, &desc, 0);
@@ -608,8 +619,8 @@ static void test_load_save(void)
      */
 
     /* DeleteFileW is not implemented on Win9x */
-    r=DeleteFileA("c:\\test.lnk");
-    ok(r, "failed to delete link (%d)\n", GetLastError());
+    r=DeleteFileA(lnkfileA);
+    ok(r, "failed to delete link '%s' (%d)\n", lnkfileA, GetLastError());
 }
 
 static void test_datalink(void)




More information about the wine-cvs mailing list