[WIN32K]
[reactos.git] / rostests / apitests / apitest.h
index ea2c3e3..e3e08e0 100644 (file)
-#ifndef _APITEST_H\r
-#define _APITEST_H\r
-\r
-#define WINVER 0x501\r
-\r
-#include <stdlib.h>\r
-#include <stdarg.h>\r
-#include <stdio.h>\r
-#include <fcntl.h>\r
-#include <windows.h>\r
-\r
-#define APISTATUS_NORMAL 0\r
-#define APISTATUS_NOT_FOUND 1\r
-#define APISTATUS_UNIMPLEMENTED 2\r
-#define APISTATUS_ASSERTION_FAILED 3\r
-#define APISTATUS_REGRESSION 4\r
-\r
-/* type definitions */\r
-\r
-typedef struct tagTESTINFO\r
-{\r
-       INT passed;\r
-       INT failed;\r
-       INT rfailed;\r
-       BOOL bRegress;\r
-       INT nApiStatus;\r
-} TESTINFO, *PTESTINFO;\r
-\r
-typedef INT (*TESTPROC)(PTESTINFO);\r
-\r
-typedef struct tagTEST\r
-{\r
-       WCHAR* Test;\r
-       TESTPROC Proc;\r
-} TESTENTRY, *PTESTENTRY;\r
-\r
-\r
-/* macros */\r
-\r
-#define TEST(x) \\r
-       if (pti->bRegress) \\r
-       { \\r
-               if (x)\\r
-               {\\r
-                       (pti->passed)++;\\r
-                       printf("non-rtest succeeded in %s:%d (%s)\n", __FILE__, __LINE__, #x);\\r
-               } else {\\r
-                       (pti->failed)++;\\r
-               } \\r
-       } \\r
-       else \\r
-       { \\r
-               if (x)\\r
-               {\\r
-                       (pti->passed)++;\\r
-               } else {\\r
-                       (pti->failed)++;\\r
-                       printf("test failed in %s:%d (%s)\n", __FILE__, __LINE__, #x);\\r
-               } \\r
-       }\r
-\r
-#define RTEST(x) \\r
-       if (pti->bRegress) \\r
-       { \\r
-               if (x)\\r
-               {\\r
-                       (pti->passed)++;\\r
-               } else {\\r
-                       (pti->failed)++;\\r
-                       (pti->rfailed)++;\\r
-                       printf("rtest failed in %s:%d (%s)\n", __FILE__, __LINE__, #x);\\r
-               } \\r
-       } \\r
-       else \\r
-       { \\r
-               if (x)\\r
-               {\\r
-                       (pti->passed)++;\\r
-               } else {\\r
-                       (pti->failed)++;\\r
-                       printf("test failed in %s:%d (%s)\n", __FILE__, __LINE__, #x);\\r
-               } \\r
-       }\r
-\r
-\r
-#define ASSERT(x) \\r
-       if (!(x)) \\r
-       { \\r
-                       printf("Assertion failed in %s:%d (%s)\n", __FILE__, __LINE__, #x);\\r
-                       return APISTATUS_ASSERTION_FAILED; \\r
-       }\r
-\r
-int TestMain(LPWSTR pszExe, LPWSTR pszModule);\r
-extern TESTENTRY TestList[];\r
-INT NumTests(void);\r
-BOOL IsFunctionPresent(LPWSTR lpszFunction);\r
-\r
-#endif /* _APITEST_H */\r
+#ifndef _APITEST_H
+#define _APITEST_H
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <windows.h>
+
+#define APISTATUS_NORMAL 0
+#define APISTATUS_NOT_FOUND 1
+#define APISTATUS_UNIMPLEMENTED 2
+#define APISTATUS_ASSERTION_FAILED 3
+#define APISTATUS_REGRESSION 4
+
+/* type definitions */
+
+typedef struct tagTESTINFO
+{
+       INT passed;
+       INT failed;
+       INT rfailed;
+       BOOL bRegress;
+       INT nApiStatus;
+} TESTINFO, *PTESTINFO;
+
+typedef INT (*TESTPROC)(PTESTINFO);
+
+typedef struct tagTEST
+{
+       WCHAR* Test;
+       TESTPROC Proc;
+} TESTENTRY, *PTESTENTRY;
+
+
+/* macros */
+
+#define TEST(x) \
+       if (pti->bRegress) \
+       { \
+               if (x)\
+               {\
+                       (pti->passed)++;\
+                       printf("%s:%d: non-rtest succeeded (%s)\n", __FILE__, __LINE__, #x);\
+               } else {\
+                       (pti->failed)++;\
+               } \
+       } \
+       else \
+       { \
+               if (x)\
+               {\
+                       (pti->passed)++;\
+               } else {\
+                       (pti->failed)++;\
+                       printf("%s:%d: test failed (%s)\n", __FILE__, __LINE__, #x);\
+               } \
+       }
+
+#define TESTX(x, format, ...) \
+       if (pti->bRegress) \
+       { \
+               if (x)\
+               {\
+                       (pti->passed)++;\
+                       printf("%s:%d: non-rtest succeeded (%s)\n", __FILE__, __LINE__, #x);\
+               } else {\
+                       (pti->failed)++;\
+               } \
+       } \
+       else \
+       { \
+               if (x)\
+               {\
+                       (pti->passed)++;\
+               } else {\
+                       (pti->failed)++;\
+                       printf("%s:%d: test failed (%s) ", __FILE__, __LINE__, #x);\
+                       printf(format, __VA_ARGS__); \
+               } \
+       }
+
+#define RTEST(x) \
+       if (pti->bRegress) \
+       { \
+               if (x)\
+               {\
+                       (pti->passed)++;\
+               } else {\
+                       (pti->failed)++;\
+                       (pti->rfailed)++;\
+                       printf("rtest failed in %s:%d (%s)\n", __FILE__, __LINE__, #x);\
+               } \
+       } \
+       else \
+       { \
+               if (x)\
+               {\
+                       (pti->passed)++;\
+               } else {\
+                       (pti->failed)++;\
+                       printf("test failed in %s:%d (%s)\n", __FILE__, __LINE__, #x);\
+               } \
+       }
+
+#undef ASSERT
+#define ASSERT(x) \
+       if (!(x)) \
+       { \
+                       printf("Assertion failed in %s:%d (%s)\n", __FILE__, __LINE__, #x);\
+                       return APISTATUS_ASSERTION_FAILED; \
+       }
+
+int TestMain(LPWSTR pszExe, LPWSTR pszModule);
+extern TESTENTRY TestList[];
+INT NumTests(void);
+BOOL IsFunctionPresent(LPWSTR lpszFunction);
+VOID DumpMem(PVOID pData, ULONG cbSize, ULONG nWidth);
+
+#endif /* _APITEST_H */