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.…
==============================================================================
--- 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 */