Fix kernel heap test

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

 



Hi,

The kernel heap test fails on Win98 and Win2k with errors like these:

heap.c:50: Test failed: GlobalReAlloc should fail on size 0, instead size=10
heap.c:69: Test failed: LocalReAlloc should fail on size 0, instead size=10

The test succeeds on Wine. This is wrong of course, tests should
always succeed on Windows and either succeed on Wine or fail on
Wine and be marked todo_wine.

The patch below reverses the logic of the [Global|Local]ReAlloc 
tests so they pass on Windows and marks them todo_wine.

 -Hans

Changelog:
  [Global|Local]ReAlloc don't fail with size 0.
  Fix typos.

Index: dlls/kernel/tests/heap.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/tests/heap.c,v
retrieving revision 1.2
diff -u -r1.2 heap.c
--- dlls/kernel/tests/heap.c	4 Dec 2003 21:52:52 -0000	1.2
+++ dlls/kernel/tests/heap.c	15 Dec 2003 15:33:02 -0000
@@ -46,8 +46,13 @@
     ok(gbl != NULL, "Can't realloc global memory");
     size = GlobalSize(gbl);
     ok(size >= 10 && size <= 16, "Memory not resized to size 10, instead size=%ld", size);
-    gbl = GlobalReAlloc(gbl, 0, GMEM_MOVEABLE);
-    ok(gbl == NULL, "GlobalReAlloc should fail on size 0, instead size=%ld", size);
+
+    todo_wine
+    { 
+        gbl = GlobalReAlloc(gbl, 0, GMEM_MOVEABLE);
+        ok(gbl != NULL, "GlobalReAlloc should not fail on size 0");
+    }
+
     size = GlobalSize(gbl);
     ok(size == 0, "Memory not resized to size 0, instead size=%ld", size);
     ok(GlobalFree(gbl) == NULL, "Memory not freed");
@@ -59,14 +64,19 @@
 
     /* Local*() functions */
     gbl = LocalAlloc(GMEM_MOVEABLE, 0);
-    ok(gbl != NULL, "global memory not allocated for size 0");
+    ok(gbl != NULL, "local memory not allocated for size 0");
 
     gbl = LocalReAlloc(gbl, 10, GMEM_MOVEABLE);
-    ok(gbl != NULL, "Can't realloc global memory");
+    ok(gbl != NULL, "Can't realloc local memory");
     size = LocalSize(gbl);
     ok(size >= 10 && size <= 16, "Memory not resized to size 10, instead size=%ld", size);
-    gbl = LocalReAlloc(gbl, 0, GMEM_MOVEABLE);
-    ok(gbl == NULL, "LocalReAlloc should fail on size 0, instead size=%ld", size);
+
+    todo_wine
+    {
+        gbl = LocalReAlloc(gbl, 0, GMEM_MOVEABLE);
+        ok(gbl != NULL, "LocalReAlloc should not fail on size 0");
+    }
+
     size = LocalSize(gbl);
     ok(size == 0, "Memory not resized to size 0, instead size=%ld", size);
     ok(LocalFree(gbl) == NULL, "Memory not freed");
@@ -74,6 +84,6 @@
     ok(size == 0, "Memory should have been freed, size=%ld", size);
 
     gbl = LocalReAlloc(0, 10, GMEM_MOVEABLE);
-    ok(gbl == NULL, "global realloc allocated memory");
+    ok(gbl == NULL, "local realloc allocated memory");
 
 }

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

  Powered by Linux