kernel[2/2]: fix path test to pass on 95 and 98

Andrew Ziem ahziem1 at mailbolt.com
Mon May 15 09:27:02 CDT 2006


changelog: fix path test to pass on 95 and 98

Before, the test would fail on 95 and 98.  Now, the test passes on 95, 
98, 2000, and Wine.
-------------- next part --------------
--- dlls/kernel/tests/path1.c	2006-05-14 23:32:47.000000000 -0600
+++ dlls/kernel/tests/path.c	2006-05-15 08:08:52.000000000 -0600
@@ -339,14 +339,22 @@
      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");
+  if (GetVersion() & 0x80000000) {
+    id=GetTempFileNameA(tmppath,NULL,0,newdir);  
+    /* 95, 98 return id==0 */  
+    ok(0==id,"Expected GetTempFileNameA to fail\n");
+  } else {
+    id=GetTempFileNameA(tmppath,NULL,0,newdir); 
+    /* 2000, XP return id!=0 */ 
+    ok(0!=id,"GetTempFileNameA failed (%ld)\n", GetLastError());
+    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-patches mailing list