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