[KMTEST]
[reactos.git] / rostests / drivers / kmtest / kmtest.h
1 #ifndef KMTEST_H
2 #define KMTEST_H
3
4 #include <stdio.h>
5 #include <stdarg.h>
6 #include <string.h>
7 #include "ntddk.h"
8
9
10 /*
11 Some macros, structs, and vars are based or inspired from the great
12 Wine regression tests Copyright (C) 2002 Alexandre Julliard.
13 Everything else is done by Aleksey Bragin based on PnPTest by Filip Navara
14 */
15
16 extern LONG successes; /* number of successful tests */
17 extern LONG failures; /* number of failures */
18 //static ULONG todo_successes; /* number of successful tests inside todo block */
19 //static ULONG todo_failures; /* number of failures inside todo block */
20
21 // We don't do multithreading, so we just keep this struct in a global var
22 typedef struct
23 {
24 const char* current_file; /* file of current check */
25 int current_line; /* line of current check */
26 int todo_level; /* current todo nesting level */
27 int todo_do_loop;
28 } tls_data;
29
30 extern tls_data glob_data;
31
32 VOID StartTest();
33 VOID FinishTest(HANDLE KeyHandle, LPWSTR TestName);
34 void kmtest_set_location(const char* file, int line);
35
36 #ifdef __GNUC__
37
38 extern int kmtest_ok( int condition, const char *msg, ... ) __attribute__((format (printf,2,3) ));
39
40 #else /* __GNUC__ */
41
42 extern int kmtest_ok( int condition, const char *msg, ... );
43
44 #endif /* __GNUC__ */
45
46
47 #define ok_(file, line) (kmtest_set_location(file, line), 0) ? 0 : kmtest_ok
48 #define ok ok_(__FILE__, __LINE__)
49
50 PDEVICE_OBJECT AttachDeviceObject;
51 PDEVICE_OBJECT MainDeviceObject;
52 PDRIVER_OBJECT ThisDriverObject;
53
54 #endif /* KMTEST_H */