[ros-diffs] [tkreuzer] 56417: [WINETESTS] Add some useful macros to wine/test.h

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Wed Apr 25 12:38:23 UTC 2012


Author: tkreuzer
Date: Wed Apr 25 12:38:23 2012
New Revision: 56417

URL: http://svn.reactos.org/svn/reactos?rev=56417&view=rev
Log:
[WINETESTS]
Add some useful macros to wine/test.h

Modified:
    trunk/reactos/include/reactos/wine/test.h

Modified: trunk/reactos/include/reactos/wine/test.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/test.h?rev=56417&r1=56416&r2=56417&view=diff
==============================================================================
--- trunk/reactos/include/reactos/wine/test.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/wine/test.h [iso-8859-1] Wed Apr 25 12:38:23 2012
@@ -623,4 +623,30 @@
 // hack for ntdll winetest (this is defined in excpt.h)
 #undef exception_info
 
+// Some helpful definitions
+
+#define ok_hex(expression, result) \
+    { \
+        int _value = (expression); \
+        ok(_value == (result), "Wrong value for '%s', expected: " #result " (0x%x), got: 0x%x\n", \
+           #expression, (int)(result), _value); \
+    }
+
+#define ok_dec(expression, result) \
+    { \
+        int _value = (expression); \
+        ok(_value == (result), "Wrong value for '%s', expected: " #result " (%d), got: %d\n", \
+           #expression, (int)(result), _value); \
+    }
+
+#define ok_err(error) \
+    ok(GetLastError() == (error), "Wrong last error. Expected " #error ", got %d\n", (int)GetLastError())
+
+#define ok_str(x, y) \
+    ok(strcmp(x, y) == 0, "Wrong string. Expected '%s', got '%s'\n", y, x);
+
+#define ok_long(expression, result) ok_hex(expression, result)
+#define ok_int(expression, result) ok_dec(expression, result)
+#define ok_ntstatus(status, expected) ok_hex(status, expected)
+
 #endif  /* __WINE_WINE_TEST_H */




More information about the Ros-diffs mailing list