reactos/rostests/apitests/apitest.h
Timo Kreuzer 58c6a293bc - make apitest.c into a static lib to be used by different tests
- add a gdi32 api test, based on the one in the win32 folder
- add a user32 api test
- change type of test functions to int
- implement a quick 'n dirty html api status output
- uncomment NtGdiTransormPoints in w32kdll.def
- add ASSERT1 macro (ASSERT is already used)
- include some more headers

svn path=/trunk/; revision=28169
2007-08-05 03:32:24 +00:00

101 lines
1.7 KiB
C

#ifndef _APITEST_H
#define _APITEST_H
#define WINVER 0x501
#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
#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("non-rtest succeeded in %s:%d (%s)\n", __FILE__, __LINE__, #x);\
} else {\
(pti->failed)++;\
} \
} \
else \
{ \
if (x)\
{\
(pti->passed)++;\
} else {\
(pti->failed)++;\
printf("test failed in %s:%d (%s)\n", __FILE__, __LINE__, #x);\
} \
}
#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);\
} \
}
#define ASSERT1(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);
#endif /* _APITEST_H */