shfolder test improvements

Vitaliy Margolen wine-patch at kievinfo.com
Sun Oct 10 12:43:02 CDT 2004


Sort test files/folders before performing checks.

Vitaliy Margolen

changelog:
   dlls/shell32/tests/shlfolder.c
   - sort files/folders before testing
-------------- next part --------------
Index: dlls/shell32/tests/shlfolder.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/tests/shlfolder.c,v
retrieving revision 1.1
diff -u -r1.1 shlfolder.c
--- dlls/shell32/tests/shlfolder.c	13 Sep 2004 23:25:09 -0000	1.1
+++ dlls/shell32/tests/shlfolder.c	10 Oct 2004 17:32:45 -0000
@@ -90,10 +90,10 @@
     static const WORD iResults [5][5] =
     {
 	{ 0,-1,-1,-1,-1},
-	{ 1, 0,-1,-1, 1},
-	{ 1, 1, 0,-1, 1},
-	{ 1, 1, 1, 0, 1},
-	{ 1,-1,-1,-1, 0}
+	{ 1, 0,-1,-1,-1},
+	{ 1, 1, 0,-1,-1},
+	{ 1, 1, 1, 0,-1},
+	{ 1, 1, 1, 1, 0}
     };
 
     if SUCCEEDED(IShellFolder_EnumObjects(iFolder, NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN, &iEnumList))
@@ -105,10 +105,19 @@
 	/* This fails on windows */
 	/* IEnumIDList_Release(iEnumList); */
     
+	/* Sort them first in case of wrong order from system */
+	for (i=0;i<5;i++) for (j=0;j<5;j++)
+	    if ((SHORT)IShellFolder_CompareIDs(iFolder, 0, idlArr[i], idlArr[j]) < 0)
+	    {
+		newPIDL = idlArr[i];
+		idlArr[i] = idlArr[j];
+		idlArr[j] = newPIDL;
+	    }
+	    
 	for (i=0;i<5;i++) for (j=0;j<5;j++)
 	{
 	    nResult = IShellFolder_CompareIDs(iFolder, 0, idlArr[i], idlArr[j]);
-	    ok(nResult == iResults[i][j], "Got %lx expected %x\n", nResult, iResults[i][j]);
+	    ok(nResult == iResults[i][j], "Got %lx expected [%d]-[%d]=%x\n", nResult, i, j, iResults[i][j]);
 	}
 
 	for (i=0;i<5;i++)


More information about the wine-patches mailing list