2 * Definitions for Wine C unit tests.
4 * Copyright (C) 2002 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 extern int winetest_debug;
30 /* current platform */
31 extern const char *winetest_platform;
33 extern void winetest_set_ok_location( const char* file, int line );
34 extern void winetest_set_trace_location( const char* file, int line );
35 extern void winetest_start_todo( const char* platform );
36 extern int winetest_loop_todo(void);
37 extern void winetest_end_todo( const char* platform );
38 extern int winetest_get_mainargs( char*** pargv );
40 #define START_TEST(name) void func_##name(void)
44 extern int winetest_ok( int condition, const char *msg, ... ) __attribute__((format (printf,2,3) ));
45 extern void winetest_trace( const char *msg, ... ) __attribute__((format (printf,1,2)));
47 #define ok(cond,args...) (winetest_set_ok_location(__FILE__, __LINE__), winetest_ok((cond),args))
48 #define trace(args...) (winetest_set_trace_location(__FILE__, __LINE__), winetest_trace(args))
52 extern int winetest_ok( int condition, const char *msg, ... );
53 extern void winetest_trace( const char *msg, ... );
55 #define ok (winetest_set_ok_location(__FILE__, __LINE__), 0) ? 0 : winetest_ok
56 #define trace (winetest_set_trace_location(__FILE__, __LINE__), 0) ? (void)0 : winetest_trace
60 #define todo(platform) for (winetest_start_todo(platform); \
61 winetest_loop_todo(); \
62 winetest_end_todo(platform))
63 #define todo_wine todo("wine")
65 #endif /* __WINE_TEST_H */