Sync(21): ntdll/tests/rtlbitmap

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

 



Hi,

License: X11

ChangeLog:

  Jon Griffiths <jon_p_griffiths@yahoo.com>

  +dlls/ntdll/tests/rtlbitmap.c
    Fix compilation with native headers

=====
"Don't wait for the seas to part, or messiahs to come;
 Don't you sit around and waste this chance..." - Live

jon_p_griffiths@yahoo.com

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
--- wine/dlls/ntdll/tests/rtlbitmap.c	Sat Apr 26 19:29:37 2003
+++ wine-develop/dlls/ntdll/tests/rtlbitmap.c	Mon Jul 14 12:32:10 2003
@@ -23,7 +23,28 @@
 #include "wine/test.h"
 #include "winbase.h"
 #include "winnt.h"
-#include "winternl.h"
+
+#ifndef __WINE_USE_NATIVE_HEADERS
+ /* Include defines for types and inlines */
+#include "winternl.h"
+#else
+/* Define the undocumented types we need here as there is no native header */
+typedef struct tagRTL_BITMAP {
+    ULONG  SizeOfBitMap;
+    LPBYTE BitMapBuffer;
+} RTL_BITMAP, *PRTL_BITMAP;
+
+typedef struct tagRTL_BITMAP_RUN {
+    ULONG StartOfRun;
+    ULONG SizeOfRun;
+} RTL_BITMAP_RUN, *PRTL_BITMAP_RUN;
+#endif
+
+#ifdef __WINE_USE_MSVCRT
+#define FS_I64 "%I64x"
+#else
+#define FS_I64 "%llx"
+#endif
 
 /* Function ptrs for ordinal calls */
 static HMODULE hntdll = 0;
@@ -88,11 +109,13 @@
   ok(bm.BitMapBuffer == buff,"buffer uninitialised");
   ok(buff[0] == 77 && buff[79] == 77, "wrote to buffer");
 
+#ifndef __WINE_USE_NATIVE_HEADERS
   /* Test inlined version */
   RtlInitializeBitMap(&bm, buff, 800);
   ok(bm.SizeOfBitMap == 800, "size uninitialised");
   ok(bm.BitMapBuffer == buff,"buffer uninitialised");
   ok(buff[0] == 77 && buff[79] == 77, "wrote to buffer");
+#endif
 }
 
 static void test_RtlSetAllBits(void)
@@ -109,11 +132,13 @@
   ok(buff[4] == 0, "set more than rounded size");
 
   /* Test inlined version */
+#ifndef __WINE_USE_NATIVE_HEADERS
   memset(buff, 0 , sizeof(buff));
   RtlSetAllBits(&bm);
   ok(buff[0] == 0xff && buff[1] == 0xff && buff[2] == 0xff &&
      buff[3] == 0xff, "didnt round up size");
   ok(buff[4] == 0, "set more than rounded size");
+#endif
 }
 
 static void test_RtlClearAllBits()
@@ -193,6 +218,9 @@
 
 static void test_RtlCheckBit()
 {
+#ifndef __WINE_USE_NATIVE_HEADERS
+  /* RtlCheckBit is a Wine inline, so don't test it with native headers */
+
   BOOLEAN bRet;
 
   memset(buff, 0 , sizeof(buff));
@@ -213,6 +241,7 @@
   ok (!bRet, "found non set bit");
   bRet = RtlCheckBit(&bm, sizeof(buff)*8-2);
   ok (!bRet, "found non set bit");
+#endif
 }
 
 static void test_RtlAreBitsSet()
@@ -444,13 +473,13 @@
     ulLong <<= i;
 
     cPos = pRtlFindMostSignificantBit(ulLong);
-    ok (cPos == i, "didnt find MSB %llx %d %d", ulLong, i, cPos);
+    ok (cPos == i, "didnt find MSB " FS_I64 " %d %d", ulLong, i, cPos);
 
     /* Set all bits lower than bit i */
     ulLong = ((ulLong - 1) << 1) | 1;
 
     cPos = pRtlFindMostSignificantBit(ulLong);
-    ok (cPos == i, "didnt find MSB %llx %d %d", ulLong, i, cPos);
+    ok (cPos == i, "didnt find MSB " FS_I64 " %d %d", ulLong, i, cPos);
   }
   cPos = pRtlFindMostSignificantBit(0);
   ok (cPos == -1, "found bit when not set");
@@ -470,12 +499,12 @@
     ulLong = (ULONGLONG)1 << i;
 
     cPos = pRtlFindLeastSignificantBit(ulLong);
-    ok (cPos == i, "didnt find LSB %llx %d %d", ulLong, i, cPos);
+    ok (cPos == i, "didnt find LSB " FS_I64 " %d %d", ulLong, i, cPos);
 
     ulLong = ~((ULONGLONG)0) << i;
 
     cPos = pRtlFindLeastSignificantBit(ulLong);
-    ok (cPos == i, "didnt find LSB %llx %d %d", ulLong, i, cPos);
+    ok (cPos == i, "didnt find LSB " FS_I64 " %d %d", ulLong, i, cPos);
   }
   cPos = pRtlFindLeastSignificantBit(0);
   ok (cPos == -1, "found bit when not set");

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

  Powered by Linux