[PSDK]
[reactos.git] / rostests / apitests / apitest.h
index 2180a02..e3e08e0 100644 (file)
@@ -4,11 +4,8 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include <stdio.h>
-#include <fcntl.h>
 #include <windows.h>
 
-#define open _open
-
 #define APISTATUS_NORMAL 0
 #define APISTATUS_NOT_FOUND 1
 #define APISTATUS_UNIMPLEMENTED 2
@@ -43,7 +40,7 @@ typedef struct tagTEST
                if (x)\
                {\
                        (pti->passed)++;\
-                       printf("non-rtest succeeded in %s:%d (%s)\n", __FILE__, __LINE__, #x);\
+                       printf("%s:%d: non-rtest succeeded (%s)\n", __FILE__, __LINE__, #x);\
                } else {\
                        (pti->failed)++;\
                } \
@@ -55,7 +52,30 @@ typedef struct tagTEST
                        (pti->passed)++;\
                } else {\
                        (pti->failed)++;\
-                       printf("test failed in %s:%d (%s)\n", __FILE__, __LINE__, #x);\
+                       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__); \
                } \
        }
 
@@ -94,5 +114,6 @@ 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 */