Fix kernel path conformance test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

The test for GetLongPathNameA fails on my Win2k test machine because it assumes
that the temporary test directory part doesn't expand. It does when TMP is something like 
C:\DOCUME~1\hans\LOCALS~1\Temp, so here's a patch that accounts for that.

 -Hans

Changelog:
  -  Account for the fact that the temporary directory may expand to a long name.


Index: path.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/tests/path.c,v
retrieving revision 1.19
diff -u -r1.19 path.c
--- path.c	5 Sep 2003 23:08:36 -0000	1.19
+++ path.c	17 Nov 2003 15:54:52 -0000
@@ -510,19 +510,20 @@
      "GetShortPathNameA should not have a trailing \\");
 
   if (pGetLongPathNameA) {
-    DWORD rc;
+    DWORD rc1,rc2;
     sprintf(tmpstr,"%s\\%s\\%s",curdir,LONGDIR,LONGFILE);
-    rc=(*pGetLongPathNameA)(tmpstr,NULL,0);
-    ok(rc==strlen(tmpstr)+1,
+    rc1=(*pGetLongPathNameA)(tmpstr,NULL,0);
+    rc2=(*pGetLongPathNameA)(curdir,NULL,0);
+    ok((rc1-strlen(tmpstr))==(rc2-strlen(curdir)),
        "GetLongPathNameA: wrong return code, %ld instead of %d",
-       rc, strlen(curdir)+1);
+       rc1, strlen(tmpstr)+1);
 
     todo_wine {
         sprintf(dir,"%c:",curDrive);
-        rc=(*pGetLongPathNameA)(dir,tmpstr,sizeof(tmpstr));
+        rc1=(*pGetLongPathNameA)(dir,tmpstr,sizeof(tmpstr));
         ok(strcmp(dir,tmpstr)==0,
            "GetLongPathNameA: returned '%s' instead of '%s' (rc=%ld)",
-           tmpstr,dir,rc);
+           tmpstr,dir,rc1);
     }
   }
 

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux