Andrew Ziem : kernel: Fix path test to pass on 95 and 98.

Alexandre Julliard julliard at wine.codeweavers.com
Wed May 17 14:48:47 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 8bed7bb61a130e824a2ee5cbb2c2e3be199c1fb8
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=8bed7bb61a130e824a2ee5cbb2c2e3be199c1fb8

Author: Andrew Ziem <ahziem1 at mailbolt.com>
Date:   Tue May 16 21:40:46 2006 -0600

kernel: Fix path test to pass on 95 and 98.

---

 dlls/kernel/tests/path.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/dlls/kernel/tests/path.c b/dlls/kernel/tests/path.c
index 1ff36bd..8b10a62 100644
--- a/dlls/kernel/tests/path.c
+++ b/dlls/kernel/tests/path.c
@@ -339,14 +339,18 @@ static void test_InitPathA(CHAR *newdir,
      newdir,tmpstr,tmpstr1,id);
   ok(DeleteFileA(newdir),"Couldn't delete the temporary file we just created\n");     
 
-  ok((id=GetTempFileNameA(tmppath,NULL,0,newdir)),"GetTempFileNameA failed\n");
-  sprintf(tmpstr,"%.4x.tmp",id & 0xffff);
-  sprintf(tmpstr1,"%x.tmp",id & 0xffff);
-  ok(lstrcmpiA(newdir+lstrlenA(tmppath),tmpstr)==0 ||
-     lstrcmpiA(newdir+lstrlenA(tmppath),tmpstr1)==0,
-     "GetTempFileNameA returned '%s' which doesn't match '%s' or '%s'. id=%x\n",
-     newdir,tmpstr,tmpstr1,id);
-  ok(DeleteFileA(newdir),"Couldn't delete the temporary file we just created\n");
+  id=GetTempFileNameA(tmppath,NULL,0,newdir);
+/* Windows 95, 98 return 0==id, while Windows 2000, XP return 0!=id */
+  if (id)
+  {
+    sprintf(tmpstr,"%.4x.tmp",id & 0xffff);
+    sprintf(tmpstr1,"%x.tmp",id & 0xffff);
+    ok(lstrcmpiA(newdir+lstrlenA(tmppath),tmpstr)==0 ||
+       lstrcmpiA(newdir+lstrlenA(tmppath),tmpstr1)==0,
+       "GetTempFileNameA returned '%s' which doesn't match '%s' or '%s'. id=%x\n",
+       newdir,tmpstr,tmpstr1,id);
+    ok(DeleteFileA(newdir),"Couldn't delete the temporary file we just created\n");
+  }
 
 /* Find first valid drive letter that is neither newdir[0] nor curDrive */
   drives = GetLogicalDrives() & ~(1<<(newdir[0]-'A'));




More information about the wine-cvs mailing list