96572c4e5d0136b4c8ab08151140c7ab580071fb
[reactos.git] / reactos / regtests / shared / regtests.h
1 /*
2 * PROJECT: ReactOS kernel
3 * FILE: regtests/shared/regtests.h
4 * PURPOSE: Regression testing
5 * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
6 * UPDATE HISTORY:
7 * 06-07-2003 CSH Created
8 */
9 #include <ntos.h>
10
11 /* Valid values for Command parameter of TestRoutine */
12 #define TESTCMD_RUN 0 /* Buffer contains information about what failed */
13 #define TESTCMD_TESTNAME 1 /* Buffer contains description of test */
14
15 /* Valid values for return values of TestRoutine */
16 #define TS_EXCEPTION -1
17 #define TS_OK 0
18 #define TS_FAILED 1
19
20 /*
21 * Test routine prototype
22 * Command - The command to process
23 * Buffer - Pointer to buffer in which to return context information
24 */
25 typedef int (*TestRoutine)(int Command, char *Buffer);
26
27 /*
28 * Test output routine prototype
29 * Buffer - Address of buffer with text to output
30 */
31 typedef void (*TestOutputRoutine)(char *Buffer);
32
33 /*
34 * Test driver entry routine.
35 * OutputRoutine - Output routine.
36 * TestName - If NULL all tests are run. If non-NULL specifies the test to be run
37 */
38 typedef void STDCALL (*TestDriverMain)(TestOutputRoutine OutputRoutine, char *TestName);
39
40 typedef struct _ROS_TEST
41 {
42 LIST_ENTRY ListEntry;
43 TestRoutine Routine;
44 } ROS_TEST, *PROS_TEST;
45
46 extern LIST_ENTRY AllTests;
47
48 extern VOID InitializeTests();
49 extern VOID RegisterTests();
50 extern VOID PerformTests(TestOutputRoutine OutputRoutine, LPSTR TestName);
51
52 /* Routines provided by the driver */
53 extern PVOID AllocateMemory(ULONG Size);
54 extern VOID FreeMemory(PVOID Base);