ReactOS 0.4.16-dev-2491-g3dc6630
test.h
Go to the documentation of this file.
1/*
2 * Definitions for Wine C unit tests.
3 *
4 * Copyright (C) 2002 Alexandre Julliard
5 *
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.
10 *
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.
15 *
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#ifndef __WINE_WINE_TEST_H
22#define __WINE_WINE_TEST_H
23
24#include <stdarg.h>
25#include <stdlib.h>
26#include <windef.h>
27#include <winbase.h>
28#include <stdio.h> // In the future: replace by <wine/debug.h>
29
30#ifdef __GNUC__
31#pragma GCC diagnostic push
32#pragma GCC diagnostic ignored "-Wunused-function"
33#endif
34
35#ifdef __WINE_CONFIG_H
36#error config.h should not be used in Wine tests
37#endif
38#ifdef __WINE_WINE_LIBRARY_H
39#error wine/library.h should not be used in Wine tests
40#endif
41#ifdef __WINE_WINE_UNICODE_H
42#error wine/unicode.h should not be used in Wine tests
43#endif
44#ifdef __WINE_WINE_DEBUG_H
45#error wine/debug.h should not be used in Wine tests
46#endif
47
48#ifdef __GNUC__
49# define __WINE_PRINTF_ATTR(fmt,args) __attribute__((format (printf,fmt,args)))
50#else /* __GNUC__ */
51# define __WINE_PRINTF_ATTR(fmt,args)
52#endif /* __GNUC__ */
53
54#ifdef __cplusplus
55extern "C" {
56#endif
57
58#ifndef INVALID_FILE_ATTRIBUTES
59#define INVALID_FILE_ATTRIBUTES (~0u)
60#endif
61#ifndef INVALID_SET_FILE_POINTER
62#define INVALID_SET_FILE_POINTER (~0u)
63#endif
64
65/* debug level */
66extern int winetest_debug;
67
68/* trace timing information */
69extern int winetest_time;
71
72/* running in interactive mode? */
73extern int winetest_interactive;
74
75/* report failed flaky tests as failures (BOOL) */
76extern int winetest_report_flaky;
77
78/* report successful tests (BOOL) */
80
81/* silence todos and skips above this threshold */
83
84/* current platform */
85extern const char *winetest_platform;
87
88/* use ANSI escape codes for output coloring */
89extern int winetest_color;
90
91extern LONG winetest_successes; /* number of successful tests */
92extern LONG winetest_failures; /* number of failures */
93extern LONG winetest_flaky_failures; /* number of failures inside flaky block */
94extern LONG winetest_skipped; /* number of skipped test chunks */
95extern LONG winetest_todo_successes; /* number of successful tests inside todo block */
96extern LONG winetest_todo_failures; /* number of failures inside todo block */
97extern LONG winetest_muted_traces; /* number of silenced traces */
98extern LONG winetest_muted_skipped; /* same as skipped but silent */
99extern LONG winetest_muted_todo_successes; /* same as todo_successes but silent */
100
101/* The following data must be kept track of on a per-thread basis */
103{
104 const char* current_file; /* file of current check */
105 int current_line; /* line of current check */
106 unsigned int flaky_level; /* current flaky nesting level */
108 unsigned int todo_level; /* current todo nesting level */
109 unsigned int nocount_level;
111 char *str_pos; /* position in debug buffer */
112 char strings[2000]; /* buffer for debug strings */
113 char context[8][128]; /* data to print before messages */
114 unsigned int context_count; /* number of context prefixes */
115};
116
118extern void winetest_print_lock(void);
119extern void winetest_print_unlock(void);
120extern int winetest_vprintf( const char *msg, va_list args );
121extern int winetest_get_time(void);
122
123extern int winetest_get_mainargs( char*** pargv );
125
126#ifdef STANDALONE
127#define START_TEST(name) \
128 static void func_##name(void); \
129 const struct test winetest_testlist[] = { { #name, func_##name }, { 0, 0 } }; \
130 static void func_##name(void)
131#else
132#define START_TEST(name) EXTERN_C void func_##name(void)
133#endif
134
135#ifdef WINETEST_NO_LINE_NUMBERS
136# define subtest_(file, line) (winetest_set_location(file, 0), 0) ? (void)0 : winetest_subtest
137# define ignore_exceptions_(file, line) (winetest_set_location(file, 0), 0) ? (void)0 : winetest_ignore_exceptions
138# define ok_(file, line) (winetest_set_location(file, 0), 0) ? (void)0 : winetest_ok
139# define skip_(file, line) (winetest_set_location(file, 0), 0) ? (void)0 : winetest_skip
140# define win_skip_(file, line) (winetest_set_location(file, 0), 0) ? (void)0 : winetest_win_skip
141# define trace_(file, line) (winetest_set_location(file, 0), 0) ? (void)0 : winetest_trace
142# define wait_child_process_(file, line) (winetest_set_location(file, 0), 0) ? (void)0 : winetest_wait_child_process
143#else
144# define subtest_(file, line) (winetest_set_location(file, line), 0) ? (void)0 : winetest_subtest
145# define ignore_exceptions_(file, line) (winetest_set_location(file, line), 0) ? (void)0 : winetest_ignore_exceptions
146# define ok_(file, line) (winetest_set_location(file, line), 0) ? (void)0 : winetest_ok
147# define skip_(file, line) (winetest_set_location(file, line), 0) ? (void)0 : winetest_skip
148# define win_skip_(file, line) (winetest_set_location(file, line), 0) ? (void)0 : winetest_win_skip
149# define trace_(file, line) (winetest_set_location(file, line), 0) ? (void)0 : winetest_trace
150# define wait_child_process_(file, line) (winetest_set_location(file, line), 0) ? (void)0 : winetest_wait_child_process
151#endif
152
153#define subtest subtest_(__FILE__, __LINE__)
154#define ignore_exceptions ignore_exceptions_(__FILE__, __LINE__)
155#define ok ok_(__FILE__, __LINE__)
156#define skip skip_(__FILE__, __LINE__)
157#define win_skip win_skip_(__FILE__, __LINE__)
158#define trace trace_(__FILE__, __LINE__)
159#define wait_child_process wait_child_process_(__FILE__, __LINE__)
160
161#define flaky_if(is_flaky) for (winetest_start_flaky(is_flaky); \
162 winetest_loop_flaky(); \
163 winetest_end_flaky())
164#define flaky flaky_if(TRUE)
165#define flaky_wine flaky_if(winetest_platform_is_wine)
166#define flaky_wine_if(is_flaky) flaky_if((is_flaky) && winetest_platform_is_wine)
167
168#define todo_if(is_todo) for (winetest_start_todo(is_todo); \
169 winetest_loop_todo(); \
170 winetest_end_todo())
171
172#define todo_ros todo_if(!strcmp(winetest_platform, "reactos"))
173#define todo_ros_if(is_todo) todo_if((is_todo) && !strcmp(winetest_platform, "reactos"))
174#ifdef USE_WINE_TODOS
175#define todo_wine todo_ros
176#define todo_wine_if todo_ros_if
177#else
178#define todo_wine todo_if(!strcmp(winetest_platform, "wine"))
179#define todo_wine_if(is_todo) todo_if((is_todo) && !strcmp(winetest_platform, "wine"))
180#endif
181
182#ifndef ARRAY_SIZE
183# define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
184#endif
185
186/* Records the location of the next check.
187 * See the xxx_(file, line) macros.
188 *
189 * Parameters:
190 * - file - source file name of the check
191 * - line - source line number of the check
192 */
193static inline void winetest_set_location( const char *file, int line )
194{
196#if defined(WINETEST_MSVC_IDE_FORMATTING)
197 data->current_file = file;
198#else
199 data->current_file=strrchr(file,'/');
200 if (data->current_file==NULL)
201 data->current_file=strrchr(file,'\\');
202 if (data->current_file==NULL)
203 data->current_file=file;
204 else
205 data->current_file++;
206#endif
207 data->current_line=line;
208}
209
210static const char winetest_color_reset[] = "\x1b[0m";
211static const char winetest_color_dark_red[] = "\x1b[31m";
212static const char winetest_color_dark_purple[] = "\x1b[35m";
213static const char winetest_color_green[] = "\x1b[32m";
214static const char winetest_color_yellow[] = "\x1b[33m";
215static const char winetest_color_blue[] = "\x1b[34m";
216static const char winetest_color_bright_red[] = "\x1b[1;91m";
217static const char winetest_color_bright_purple[] = "\x1b[1;95m";
218
219/* Define WINETEST_MSVC_IDE_FORMATTING to alter the output format winetest will use for file/line numbers.
220 This alternate format makes the file/line numbers clickable in visual studio, to directly jump to them. */
221#if defined(WINETEST_MSVC_IDE_FORMATTING)
222# define __winetest_file_line_prefix "%s(%d)"
223#else
224# define __winetest_file_line_prefix "%s:%d"
225#endif
226
227static int winetest_printf( const char *msg, ... ) __WINE_PRINTF_ATTR(1,2);
228static int winetest_printf( const char *msg, ... )
229{
232 int ret;
233
234 fprintf( stdout, __winetest_file_line_prefix ": ", data->current_file, data->current_line );
235 va_start( valist, msg );
237 va_end( valist );
238
239 return ret;
240}
241
242static const char *winetest_elapsed( char *buffer )
243{
244 int now;
245
246 if (!winetest_time) return "";
248 sprintf( buffer, "%.3f", (now - winetest_start_time) / 1000.0 );
249 return buffer;
250}
251
252static void winetest_print_location( const char *msg, ... ) __WINE_PRINTF_ATTR(1,2);
253static void winetest_print_location( const char *msg, ... )
254{
257
258 winetest_printf( "%s:%d ", data->current_file, data->current_line );
259 va_start( valist, msg );
261 va_end( valist );
262}
263
264static void winetest_print_context( const char *msgtype )
265{
267 unsigned int i;
268
269 winetest_printf( "%s", msgtype );
270 for (i = 0; i < data->context_count; ++i)
271 fprintf( stdout, "%s: ", data->context[i] );
272}
273
274static inline void winetest_subtest( const char *name )
275{
278 data->current_file, data->current_line, name);
279}
280
281static inline void winetest_ignore_exceptions( BOOL ignore )
282{
283 winetest_print_location( "IgnoreExceptions=%d\n", ignore ? 1 : 0 );
284}
285
286static inline int broken( int condition )
287{
288 return ((strcmp(winetest_platform, "windows") == 0)
289#ifndef USE_WINE_TODOS
290 || (strcmp(winetest_platform, "reactos") == 0)
291#endif
292 ) && condition;
293}
294
296{
297 /* counts how many times a given line printed a message */
298 static LONG line_counters[16384];
299
301 int index, count;
302
303 if (winetest_debug > 1)
304 return 0;
305
307 index = data->current_line % ARRAY_SIZE(line_counters);
308 count = InterlockedIncrement(line_counters + index) - 1;
310 {
311 //winetest_print_lock();
312 winetest_print_location( "Line has been silenced after %d occurrences\n", winetest_mute_threshold );
313 //winetest_print_unlock();
314 }
315
316 return count;
317}
318
319/*
320 * Checks that a condition has the expected value, that is true except if
321 * preceded by a todo indicating the check is expected to fail.
322 *
323 * Parameters:
324 * - condition - true if the check succeeded, false otherwise;
325 * - msg - failure message format;
326 * - args - arguments for the failure message
327 * Return:
328 * 0 if condition does not have the expected value, 1 otherwise
329 */
330static int winetest_vok( int condition, const char *msg, va_list args )
331{
333
334 if (data->todo_level)
335 {
336 if (condition)
337 {
338 winetest_print_context( "Test succeeded inside todo block: " );
340 if ((data->nocount_level & 2) == 0)
342 return 0;
343 }
344 else
345 {
346 /* show todos even if traces are disabled*/
347 /*if (winetest_debug > 0)*/
348 {
349 winetest_print_context( "Test marked todo: " );
351 }
352 if ((data->nocount_level & 1) == 0)
354 return 1;
355 }
356 }
357 else
358 {
359 if (!condition)
360 {
361 winetest_print_context( "Test failed: " );
363 if ((data->nocount_level & 2) == 0)
365 return 0;
366 }
367 else
368 {
369 if (winetest_report_success && (data->nocount_level & 1) == 0)
370 {
371 winetest_printf("Test succeeded\n");
372 }
373 if ((data->nocount_level & 1) == 0)
375 return 1;
376 }
377 }
378}
379
380void winetest_ok( int condition, const char *msg, ... ) __WINE_PRINTF_ATTR(2,3);
381#ifdef STANDALONE
382void winetest_ok( int condition, const char *msg, ... )
383{
385
388 va_end(valist);
389}
390#endif // STANDALONE
391
392void winetest_trace( const char *msg, ... ) __WINE_PRINTF_ATTR(1,2);
393#ifdef STANDALONE
394void winetest_trace( const char *msg, ... )
395{
397
398 if (winetest_debug > 0)
399 {
403 va_end(valist);
404 }
405}
406#endif // STANDALONE
407
408static void winetest_vskip( const char *msg, va_list args )
409{
410 winetest_print_context( "Tests skipped: " );
413}
414
415/*
416 * Prints a message to indicate that a group of tests is being skipped
417 * because the requirements for running them are not met.
418 *
419 * Parameters:
420 * - msg - failure message format;
421 * - args - arguments for the failure message
422 */
423void winetest_skip( const char *msg, ... ) __WINE_PRINTF_ATTR(1,2);
424#ifdef STANDALONE
425void winetest_skip( const char *msg, ... )
426{
430 va_end(valist);
431}
432#endif // STANDALONE
433
434static void winetest_win_skip( const char *msg, ... ) __WINE_PRINTF_ATTR(1,2);
435static inline void winetest_win_skip( const char *msg, ... )
436{
439 if ((strcmp(winetest_platform, "windows") == 0)
440#if !defined(USE_WINE_TODOS) || defined(USE_WIN_SKIP)
441 || (strcmp(winetest_platform, "reactos") == 0)
442#endif
443 )
445 else
447 va_end(valist);
448}
449
450/* If is_flaky is true, indicates that the next test may occasionally fail due
451 * to unavoidable outside race conditions. Such failures will be flagged as
452 * flaky so they can be ignored by automated testing tools.
453 *
454 * Remarks:
455 * - This is not meant to paper over race conditions within the test itself.
456 * Those are bugs and should be fixed.
457 * - This is not meant to be used for tests that normally succeed but
458 * systematically fail on a specific platform or locale.
459 * - The failures should be rare to start with. If a test fails 25% of the time
460 * it is probably wrong.
461 */
462static inline void winetest_start_flaky( int is_flaky )
463{
465 data->flaky_level = (data->flaky_level << 1) | (is_flaky != 0);
466 data->flaky_do_loop = 1;
467}
468
469static inline int winetest_loop_flaky(void)
470{
472 int do_flaky = data->flaky_do_loop;
473 data->flaky_do_loop = 0;
474 return do_flaky;
475}
476
477static inline void winetest_end_flaky(void)
478{
480 data->flaky_level >>= 1;
481}
482
483/* If is_todo is true, indicates that the next test is expected to fail on this
484 * platform. This is used to identify tests that are known to fail in Wine.
485 *
486 * Remarks:
487 * - is_todo should never be true on Windows. To ensure this, always use
488 * todo_wine_if().
489 */
490static inline void winetest_start_todo( int is_todo )
491{
493 data->todo_level = (data->todo_level << 1) | (is_todo != 0);
494 data->todo_do_loop=1;
495}
496
497static inline int winetest_loop_todo(void)
498{
500 int do_loop=data->todo_do_loop;
501 data->todo_do_loop=0;
502 return do_loop;
503}
504
505static inline void winetest_end_todo(void)
506{
508 data->todo_level >>= 1;
509}
510
511/* Adds a string to be prepended to the test traces and failure messages.
512 * This must be paired with a winetest_pop_context() call.
513 *
514 * Parameters:
515 * - msg - failure message format;
516 * - args - arguments for the failure message
517 *
518 * Remarks:
519 * - Failure messages must always make it possible to figure out what was being
520 * tested. While not ideal the line number can usually be used for that
521 * purpose except when the test loops on a list of test parameters. In such
522 * cases either the test parameters or the loop index should be added to the
523 * context.
524 *
525 * Example:
526 *
527 * for (i = 0; i < ARRAY_SIZE(test_parameters); i++)
528 * {
529 * winetest_push_context("%d", i);
530 * ...
531 * ok(WinAPI(test_parameters[i]), ...);
532 * ...
533 * winetest_pop_context();
534 * }
535 */
536static void winetest_push_context( const char *fmt, ... ) __WINE_PRINTF_ATTR(1, 2);
537static inline void winetest_push_context( const char *fmt, ... )
538{
541
542 if (data->context_count < ARRAY_SIZE(data->context))
543 {
545 vsnprintf( data->context[data->context_count], sizeof(data->context[data->context_count]), fmt, valist );
546 va_end(valist);
547 data->context[data->context_count][sizeof(data->context[data->context_count]) - 1] = 0;
548 }
549 ++data->context_count;
550}
551
552static inline void winetest_pop_context(void)
553{
555
556 if (data->context_count)
557 --data->context_count;
558}
559
560static inline LONG winetest_get_failures(void)
561{
562 return winetest_failures;
563}
564
565static inline void winetest_add_failures( LONG new_failures )
566{
567 while (new_failures-- > 0) InterlockedIncrement( &winetest_failures );
568}
569
570
571/************************************************************************/
572/* Below is the implementation of the various functions, to be included
573 * directly into the generated testlist.c file.
574 * It is done that way so that the dlls can build the test routines with
575 * different includes or flags if needed.
576 */
577
578#ifdef STANDALONE
579
580#include <stdio.h>
581#include <excpt.h>
582
583struct test
584{
585 const char *name;
586 void (*func)(void);
587};
588
589extern const struct test winetest_testlist[];
590
591/* debug level */
592int winetest_debug = 1;
593
594/* trace timing information */
595int winetest_time = 0;
597
598/* interactive mode? */
600
601/* current platform */
602const char *winetest_platform = "windows";
604
605/* report failed flaky tests as failures (BOOL) */
607
608/* report successful tests (BOOL) */
610
611/* silence todos and skips above this threshold */
613
614/* use ANSI escape codes for output coloring */
615int winetest_color = 0;
616
617static HANDLE winetest_mutex;
618
619/* passing arguments around */
620static int winetest_argc;
621static char** winetest_argv;
622
623static const struct test *current_test; /* test currently being run */
624
625LONG winetest_successes = 0; /* number of successful tests */
626LONG winetest_failures = 0; /* number of failures */
627LONG winetest_flaky_failures = 0; /* number of failures inside flaky block */
628LONG winetest_skipped = 0; /* number of skipped test chunks */
629LONG winetest_todo_successes = 0; /* number of successful tests inside todo block */
630LONG winetest_todo_failures = 0; /* number of failures inside todo block */
631LONG winetest_muted_traces = 0; /* number of silenced traces */
632LONG winetest_muted_skipped = 0; /* same as skipped but silent */
633LONG winetest_muted_todo_successes = 0; /* same as todo_successes but silent */
634
635static DWORD tls_index;
636
638{
641
643 data=(struct winetest_thread_data*)TlsGetValue(tls_index);
644 if (!data)
645 {
647 data->str_pos = data->strings;
648 TlsSetValue(tls_index,data);
649 }
651 return data;
652}
653
654static void exit_process( int code )
655{
656 fflush( stdout );
657 ExitProcess( code );
658}
659
660void winetest_print_lock(void)
661{
662 UINT ret;
663
664 if (!winetest_mutex) return;
665 ret = WaitForSingleObject( winetest_mutex, 30000 );
666 if (ret != WAIT_OBJECT_0 && ret != WAIT_ABANDONED)
667 {
668 winetest_print_location( "could not get the print lock: %u\n", ret );
669 winetest_mutex = 0;
670 }
671}
672
673void winetest_print_unlock(void)
674{
675 if (winetest_mutex) ReleaseMutex( winetest_mutex );
676}
677
678int winetest_vprintf( const char *msg, va_list args )
679{
681
682 fprintf(stdout, __winetest_file_line_prefix ": ", data->current_file, data->current_line);
683 return vfprintf(stdout, msg, args);
684}
685
686int winetest_get_time(void)
687{
688 return GetTickCount();
689}
690
691int winetest_get_mainargs( char ***pargv )
692{
693 *pargv = winetest_argv;
694 return winetest_argc;
695}
696
698{
699 DWORD exit_code = 1;
700
701 if (WaitForSingleObject( process, 30000 ))
702 fprintf( stdout, "%s: child process wait failed\n", current_test->name );
703 else
705
706 if (exit_code)
707 {
708 if (exit_code > 255)
709 {
710 fprintf( stdout, "%s: exception 0x%08x in child process\n", current_test->name, (unsigned)exit_code );
712 }
713 else
714 {
715 fprintf( stdout, "%s: %u failures in child process\n",
716 current_test->name, (unsigned)exit_code );
717 while (exit_code-- > 0)
719 }
720 }
721}
722
723/* Find a test by name */
724static const struct test *find_test( const char *name )
725{
726 const struct test *test;
727 const char *p;
728 size_t len;
729
730 if ((p = strrchr( name, '/' ))) name = p + 1;
731 if ((p = strrchr( name, '\\' ))) name = p + 1;
732 len = strlen(name);
733 if (len > 2 && !strcmp( name + len - 2, ".c" )) len -= 2;
734
735 for (test = winetest_testlist; test->name; test++)
736 {
737 if (!strncmp( test->name, name, len ) && !test->name[len]) break;
738 }
739 return test->name ? test : NULL;
740}
741
742
743/* Display list of valid tests */
744static void list_tests(void)
745{
746 const struct test *test;
747
748 fprintf( stdout, "Valid test names:\n" );
749 for (test = winetest_testlist; test->name; test++) fprintf( stdout, " %s\n", test->name );
750}
751
752/* Disable false-positive claiming "test" would be NULL-dereferenced */
753#if defined(_MSC_VER)
754#pragma warning(push)
755#pragma warning(disable:28182)
756#endif
757
758/* Run a named test, and return exit status */
759static int run_test( const char *name )
760{
761 const struct test *test;
762 int status;
763
764 if (!(test = find_test( name )))
765 {
766 fprintf( stdout, "Fatal: test '%s' does not exist.\n", name );
767 exit_process(1);
768 }
770 tls_index=TlsAlloc();
771 current_test = test;
772 test->func();
773
774 /* show test results even if traces are disabled */
775 /*if (winetest_debug)*/
776 {
777 fprintf( stdout, "\n%s: %d tests executed (%d marked as todo, %d %s), %d skipped.\n",
780 (winetest_failures + winetest_todo_failures != 1) ? "failures" : "failure",
781 (int)winetest_skipped );
782 }
784 return status;
785}
786
787#if defined(_MSC_VER)
788#pragma warning(pop)
789#endif
790
791/* Display usage and exit */
792static void usage( const char *argv0 )
793{
794 fprintf( stdout, "Usage: %s test_name\n\n", argv0 );
795 list_tests();
796 exit_process(1);
797}
798
799/* trap unhandled exceptions */
800static LONG CALLBACK exc_filter( EXCEPTION_POINTERS *ptrs )
801{
803 char elapsed[64];
804
806 if (data->current_file)
807 printf( "%s:%d: this is the last test seen before the exception\n",
808 data->current_file, data->current_line );
810 printf( "%04x:%s:%s unhandled exception %08x at %p\n",
811 (UINT)GetCurrentProcessId(), current_test->name, winetest_elapsed( elapsed ),
814 fflush( stdout );
817}
818
819/* check if we're running under wine */
820static BOOL running_under_wine(void)
821{
822 HMODULE module = GetModuleHandleA( "ntdll.dll" );
823 if (!module) return FALSE;
824 return (GetProcAddress( module, "wine_server_call" ) != NULL);
825}
826
827/* main function */
828int main( int argc, char **argv )
829{
830 char p[128];
831
832 setvbuf (stdout, NULL, _IONBF, 0);
833 winetest_mutex = CreateMutexA(NULL, FALSE, "winetest_print_mutex");
834
835 winetest_argc = argc;
836 winetest_argv = argv;
837
838 if (GetEnvironmentVariableA( "WINETEST_PLATFORM", p, sizeof(p) )) winetest_platform = _strdup(p);
839 if (GetEnvironmentVariableA( "WINETEST_DEBUG", p, sizeof(p) )) winetest_debug = atoi(p);
840 if (GetEnvironmentVariableA( "WINETEST_INTERACTIVE", p, sizeof(p) )) winetest_interactive = atoi(p);
841 if (GetEnvironmentVariableA( "WINETEST_REPORT_SUCCESS", p, sizeof(p) )) winetest_report_success = atoi(p);
842
844
845 if (!argv[1])
846 {
847 if (winetest_testlist[0].name && !winetest_testlist[1].name) /* only one test */
848 return run_test( winetest_testlist[0].name );
849 usage( argv[0] );
850 }
851 if (!strcmp( argv[1], "--list" ))
852 {
853 list_tests();
854 return 0;
855 }
856 return run_test(argv[1]);
857}
858
859#endif /* STANDALONE */
860
861#ifdef __REACTOS__
862
863// These can go away, once all winetests are synced
864#ifdef NONAMELESSUNION
865# define U(x) (x).u
866# define U1(x) (x).u1
867# define U2(x) (x).u2
868# define U3(x) (x).u3
869# define U4(x) (x).u4
870# define U5(x) (x).u5
871# define U6(x) (x).u6
872# define U7(x) (x).u7
873# define U8(x) (x).u8
874#else
875# define U(x) (x)
876# define U1(x) (x)
877# define U2(x) (x)
878# define U3(x) (x)
879# define U4(x) (x)
880# define U5(x) (x)
881# define U6(x) (x)
882# define U7(x) (x)
883# define U8(x) (x)
884#endif
885
886#ifdef NONAMELESSSTRUCT
887# define S(x) (x).s
888# define S1(x) (x).s1
889# define S2(x) (x).s2
890# define S3(x) (x).s3
891# define S4(x) (x).s4
892# define S5(x) (x).s5
893#else
894# define S(x) (x)
895# define S1(x) (x)
896# define S2(x) (x)
897# define S3(x) (x)
898# define S4(x) (x)
899# define S5(x) (x)
900#endif
901
902// FIXME: Should include wine/debug.h instead
903extern const char *wine_dbgstr_wn( const WCHAR *str, intptr_t n );
904extern const char *wine_dbgstr_an( const CHAR *str, intptr_t n );
905extern const char *wine_dbgstr_guid( const GUID *guid );
906extern const char *wine_dbgstr_point( const POINT *guid );
907extern const char *wine_dbgstr_size( const SIZE *guid );
908extern const char *wine_dbgstr_rect( const RECT *rect );
909#ifdef WINETEST_USE_DBGSTR_LONGLONG
910extern const char *wine_dbgstr_longlong( ULONGLONG ll );
911#endif
912static inline const char *debugstr_a( const char *s ) { return wine_dbgstr_an( s, -1 ); }
913static inline const char *debugstr_an( const CHAR *s, intptr_t n ) { return wine_dbgstr_an( s, n ); }
914static inline const char *debugstr_w( const WCHAR *s ) { return wine_dbgstr_wn( s, -1 ); }
915static inline const char *debugstr_wn( const WCHAR *s, int n ) { return wine_dbgstr_wn( s, n ); }
916static inline const char *debugstr_guid( const struct _GUID *id ) { return wine_dbgstr_guid(id); }
917static inline const char *wine_dbgstr_a( const char *s ) { return wine_dbgstr_an( s, -1 ); }
918static inline const char *wine_dbgstr_w( const WCHAR *s ) { return wine_dbgstr_wn( s, -1 ); }
919#if defined(__oaidl_h__) && defined(V_VT)
920extern const char *wine_dbgstr_variant(const VARIANT *var);
921static inline const char *debugstr_variant( const VARIANT *v ) { return wine_dbgstr_variant( v ); }
922#endif
923
924/* strcmpW is available for tests compiled under Wine, but not in standalone
925 * builds under Windows, so we reimplement it under a different name. */
926static inline int winetest_strcmpW( const WCHAR *str1, const WCHAR *str2 )
927{
928 while (*str1 && (*str1 == *str2)) { str1++; str2++; }
929 return *str1 - *str2;
930}
931
932extern LONG winetest_get_successes(void);
933extern void winetest_print(const char* msg, ...) __WINE_PRINTF_ATTR( 1, 2);
934
935extern void winetest_start_nocount(unsigned int flags);
936extern int winetest_loop_nocount(void);
937extern void winetest_end_nocount(void);
938
939// hack for ntdll winetest (this is defined in excpt.h)
940#undef exception_info
941
942// Some helpful definitions
943
944#define ros_skip_flaky for (winetest_start_nocount(3); \
945 winetest_loop_nocount(); \
946 winetest_end_nocount())
947
948#define disable_success_count for (winetest_start_nocount(1); \
949 winetest_loop_nocount(); \
950 winetest_end_nocount())
951
952#define skip_2k3_crash if (_winver < 0x600) skip("Test skipped, because it crashes on win 2003\n"); else
953#define skip_2k3_fail if (_winver < 0x600) skip("Test skipped, because it fails on win 2003\n"); else
954
955#define ok_hex_(file, line, expression, result) \
956 do { \
957 int _value = (expression); \
958 int _result = (result); \
959 ok_(file, line)(_value == _result, "Wrong value for '%s', expected: " #result " (0x%x), got: 0x%x\n", \
960 #expression, _result, _value); \
961 } while (0)
962#define ok_hex(expression, result) ok_hex_(__FILE__, __LINE__, expression, result)
963
964#define ok_dec_(file, line, expression, result) \
965 do { \
966 int _value = (expression); \
967 int _result = (result); \
968 ok_(file, line)(_value == _result, "Wrong value for '%s', expected: " #result " (%d), got: %d\n", \
969 #expression, _result, _value); \
970 } while (0)
971#define ok_dec(expression, result) ok_dec_(__FILE__, __LINE__, expression, result)
972
973#define ok_ptr_(file, line, expression, result) \
974 do { \
975 const void *_value = (expression); \
976 const void *_result = (result); \
977 ok_(file, line)(_value == _result, "Wrong value for '%s', expected: " #result " (%p), got: %p\n", \
978 #expression, _result, _value); \
979 } while (0)
980#define ok_ptr(expression, result) ok_ptr_(__FILE__, __LINE__, expression, result)
981
982#define ok_size_t_(file, line, expression, result) \
983 do { \
984 size_t _value = (expression); \
985 size_t _result = (result); \
986 ok_(file, line)(_value == _result, "Wrong value for '%s', expected: " #result " (%Ix), got: %Ix\n", \
987 #expression, _result, _value); \
988 } while (0)
989#define ok_size_t(expression, result) ok_size_t_(__FILE__, __LINE__, expression, result)
990
991#define ok_char(expression, result) ok_hex(expression, result)
992
993#define ok_err_(file, line, error) \
994 ok_(file, line)(GetLastError() == (error), "Wrong last error. Expected " #error ", got 0x%lx\n", GetLastError())
995#define ok_err(error) ok_err_(__FILE__, __LINE__, error)
996
997#define ok_str_(file, line, x, y) \
998 ok_(file, line)(strcmp(x, y) == 0, "Wrong string. Expected '%s', got '%s'\n", y, x)
999#define ok_str(x, y) ok_str_(__FILE__, __LINE__, x, y)
1000
1001#define ok_wstr_(file, line, x, y) \
1002 ok_(file, line)(wcscmp(x, y) == 0, "Wrong string. Expected '%S', got '%S'\n", y, x)
1003#define ok_wstr(x, y) ok_wstr_(__FILE__, __LINE__, x, y)
1004
1005#define ok_long(expression, result) ok_hex(expression, result)
1006#define ok_int(expression, result) ok_dec(expression, result)
1007#define ok_int_(file, line, expression, result) ok_dec_(file, line, expression, result)
1008#define ok_ntstatus(status, expected) ok_hex(status, expected)
1009#define ok_hdl ok_ptr
1010
1011#define is_reactos() \
1012 (*(unsigned*)((size_t)0x7FFE0FFC) == 0x8EAC705)
1013
1014/* ReactOS specific extensions, useful for patches */
1015#define KUSER_SHARED_DATA_UMPTR 0x7FFE0000
1016#define GetMajorNTVersion() (*(ULONG*)(KUSER_SHARED_DATA_UMPTR + 0x026C))
1017#define GetMinorNTVersion() (*(ULONG*)(KUSER_SHARED_DATA_UMPTR + 0x0270))
1018#define GetNTVersion() ((GetMajorNTVersion() << 8) | GetMinorNTVersion())
1019
1020#ifdef STANDALONE
1021
1023{
1024 return winetest_successes;
1025}
1026
1027void winetest_print(const char* msg, ...)
1028{
1031
1032 fprintf(stdout, __winetest_file_line_prefix ": ", data->current_file, data->current_line);
1035 va_end(valist);
1036}
1037
1038void winetest_start_nocount(unsigned int flags)
1039{
1041
1042 /* The lowest 2 bits of nocount_level specify whether counting of successes
1043 and/or failures is disabled. For each nested level the bits are shifted
1044 left, the new lowest 2 bits are copied from the previous state and ored
1045 with the new mask. This allows nested handling of both states up tp a
1046 level of 16. */
1047 flags |= data->nocount_level & 3;
1048 data->nocount_level = (data->nocount_level << 2) | flags;
1049 data->todo_do_loop = 1;
1050}
1051
1052int winetest_loop_nocount(void)
1053{
1055 int do_loop = data->todo_do_loop;
1056 data->todo_do_loop = 0;
1057 return do_loop;
1058}
1059
1060void winetest_end_nocount(void)
1061{
1063 data->nocount_level >>= 2;
1064}
1065
1066/* allocate some tmp space for a string */
1067static char *get_temp_buffer( size_t n )
1068{
1070 char *res = data->str_pos;
1071
1072 if (res + n >= &data->strings[sizeof(data->strings)]) res = data->strings;
1073 data->str_pos = res + n;
1074 return res;
1075}
1076
1077/* release extra space that we requested in gimme1() */
1078static void release_temp_buffer( char *ptr, size_t size )
1079{
1081 data->str_pos = ptr + size;
1082}
1083
1084const char *wine_dbgstr_an( const CHAR *str, intptr_t n )
1085{
1086 char *dst, *res;
1087 size_t size;
1088
1089 if (!((ULONG_PTR)str >> 16))
1090 {
1091 if (!str) return "(null)";
1092 res = get_temp_buffer( 6 );
1093 sprintf( res, "#%04x", LOWORD(str) );
1094 return res;
1095 }
1096 if (n == -1)
1097 {
1098 const CHAR *end = str;
1099 while (*end) end++;
1100 n = end - str;
1101 }
1102 if (n < 0) n = 0;
1103 size = 12 + min( 300, n * 5 );
1104 dst = res = get_temp_buffer( size );
1105 *dst++ = '"';
1106 while (n-- > 0 && dst <= res + size - 10)
1107 {
1108 CHAR c = *str++;
1109 switch (c)
1110 {
1111 case '\n': *dst++ = '\\'; *dst++ = 'n'; break;
1112 case '\r': *dst++ = '\\'; *dst++ = 'r'; break;
1113 case '\t': *dst++ = '\\'; *dst++ = 't'; break;
1114 case '"': *dst++ = '\\'; *dst++ = '"'; break;
1115 case '\\': *dst++ = '\\'; *dst++ = '\\'; break;
1116 default:
1117 if (c >= ' ' && c <= 126)
1118 *dst++ = (char)c;
1119 else
1120 {
1121 *dst++ = '\\';
1122 sprintf(dst,"%04x",c);
1123 dst+=4;
1124 }
1125 }
1126 }
1127 *dst++ = '"';
1128 if (n > 0)
1129 {
1130 *dst++ = '.';
1131 *dst++ = '.';
1132 *dst++ = '.';
1133 }
1134 *dst++ = 0;
1136 return res;
1137}
1138
1139const char *wine_dbgstr_wn( const WCHAR *str, intptr_t n )
1140{
1141 char *res;
1142 static const char hex[16] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
1143 char buffer[300], *dst = buffer;
1144
1145 if (!str) return "(null)";
1146 if (!((ULONG_PTR)str >> 16))
1147 {
1148 res = get_temp_buffer( 6 );
1149 sprintf( res, "#%04x", LOWORD(str) );
1150 return res;
1151 }
1152 if (IsBadStringPtrW(str,n)) return "(invalid)";
1153 if (n == -1) for (n = 0; str[n]; n++) ;
1154 *dst++ = 'L';
1155 *dst++ = '"';
1156 while (n-- > 0 && dst <= buffer + sizeof(buffer) - 10)
1157 {
1158 WCHAR c = *str++;
1159 switch (c)
1160 {
1161 case '\n': *dst++ = '\\'; *dst++ = 'n'; break;
1162 case '\r': *dst++ = '\\'; *dst++ = 'r'; break;
1163 case '\t': *dst++ = '\\'; *dst++ = 't'; break;
1164 case '"': *dst++ = '\\'; *dst++ = '"'; break;
1165 case '\\': *dst++ = '\\'; *dst++ = '\\'; break;
1166 default:
1167 if (c < ' ' || c >= 127)
1168 {
1169 *dst++ = '\\';
1170 *dst++ = hex[(c >> 12) & 0x0f];
1171 *dst++ = hex[(c >> 8) & 0x0f];
1172 *dst++ = hex[(c >> 4) & 0x0f];
1173 *dst++ = hex[c & 0x0f];
1174 }
1175 else *dst++ = (char)c;
1176 }
1177 }
1178 *dst++ = '"';
1179 if (n > 0)
1180 {
1181 *dst++ = '.';
1182 *dst++ = '.';
1183 *dst++ = '.';
1184 }
1185 *dst = 0;
1186
1188 strcpy(res, buffer);
1189 return res;
1190}
1191
1192const char *wine_dbgstr_guid( const GUID *guid )
1193{
1194 char *res;
1195
1196 if (!guid) return "(null)";
1197 res = get_temp_buffer( 39 ); /* CHARS_IN_GUID */
1198 sprintf( res, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
1199 (unsigned int)guid->Data1, guid->Data2, guid->Data3, guid->Data4[0],
1200 guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4],
1201 guid->Data4[5], guid->Data4[6], guid->Data4[7] );
1202 return res;
1203}
1204
1205const char *wine_dbgstr_point( const POINT *point )
1206{
1207 char *res;
1208
1209 if (!point) return "(null)";
1210 res = get_temp_buffer( 60 );
1211#ifdef __ROS_LONG64__
1212 sprintf( res, "(%d,%d)", point->x, point->y );
1213#else
1214 sprintf( res, "(%ld,%ld)", point->x, point->y );
1215#endif
1217 return res;
1218}
1219
1220const char *wine_dbgstr_size( const SIZE *size )
1221{
1222 char *res;
1223
1224 if (!size) return "(null)";
1225 res = get_temp_buffer( 60 );
1226#ifdef __ROS_LONG64__
1227 sprintf( res, "(%d,%d)", size->cx, size->cy );
1228#else
1229 sprintf( res, "(%ld,%ld)", size->cx, size->cy );
1230#endif
1232 return res;
1233}
1234
1235const char *wine_dbgstr_rect( const RECT *rect )
1236{
1237 char *res;
1238
1239 if (!rect) return "(null)";
1240 res = get_temp_buffer( 60 );
1241#ifdef __ROS_LONG64__
1242 sprintf( res, "(%d,%d)-(%d,%d)", rect->left, rect->top, rect->right, rect->bottom );
1243#else
1244 sprintf( res, "(%ld,%ld)-(%ld,%ld)", rect->left, rect->top, rect->right, rect->bottom );
1245#endif
1247 return res;
1248}
1249
1250#ifdef WINETEST_USE_DBGSTR_LONGLONG
1251const char *wine_dbgstr_longlong( ULONGLONG ll )
1252{
1253 char *res;
1254
1255 res = get_temp_buffer( 20 );
1256 if (/*sizeof(ll) > sizeof(unsigned long) &&*/ ll >> 32) /* ULONGLONG is always > long in ReactOS */
1257 sprintf( res, "%lx%08lx", (unsigned long)(ll >> 32), (unsigned long)ll );
1258 else
1259 sprintf( res, "%lx", (unsigned long)ll );
1261 return res;
1262}
1263#endif
1264
1265#if defined(__oaidl_h__) && defined(V_VT)
1266const char *wine_dbgstr_variant(const VARIANT *var)
1267{
1268 static char buf[400];
1269
1270 if (!var)
1271 return "(null)";
1272
1273 switch (V_VT(var))
1274 {
1275 case VT_EMPTY:
1276 return "{VT_EMPTY}";
1277 case VT_BSTR:
1278 sprintf(buf, "{VT_BSTR: %s}", wine_dbgstr_w(V_BSTR(var)));
1279 break;
1280 case VT_BOOL:
1281 sprintf(buf, "{VT_BOOL: %x}", V_BOOL(var));
1282 break;
1283 case VT_UI4:
1284 sprintf(buf, "{VT_UI4: %u}", V_UI4(var));
1285 break;
1286 default:
1287 sprintf(buf, "{vt %d}", V_VT(var));
1288 break;
1289 }
1290
1291 return buf;
1292}
1293#endif
1294
1295#endif
1296
1297#ifdef __cplusplus
1298} /* extern "C" */
1299#endif
1300
1301#ifdef __GNUC__
1302#pragma GCC diagnostic pop
1303#endif
1304
1305#endif // __REACTOS__
1306
1307#endif /* __WINE_WINE_TEST_H */
#define InterlockedIncrement
Definition: armddk.h:53
static const char * wine_dbgstr_point(const POINT *ppt)
Definition: atltest.h:138
static const char * wine_dbgstr_size(const SIZE *psize)
Definition: atltest.h:155
#define broken(x)
Definition: atltest.h:178
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define msg(x)
Definition: auth_time.c:54
#define index(s, c)
Definition: various.h:29
w ll
Definition: byte_order.h:167
#define _strdup
Definition: debug_ros.c:7
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
static INT do_loop(const PropSheetInfo *psInfo)
Definition: propsheet.c:2800
const char * wine_dbgstr_an(const char *str, int n)
Definition: compat.c:313
#define GetProcessHeap()
Definition: compat.h:736
#define SetLastError(x)
Definition: compat.h:752
#define GetProcAddress(x, y)
Definition: compat.h:753
#define HeapAlloc
Definition: compat.h:733
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:55
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:49
#define CALLBACK
Definition: compat.h:35
#define GetEnvironmentVariableA(x, y, z)
Definition: compat.h:754
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
@ VT_BSTR
Definition: compat.h:2303
@ VT_BOOL
Definition: compat.h:2306
@ VT_UI4
Definition: compat.h:2313
@ VT_EMPTY
Definition: compat.h:2295
UINT WINAPI SetErrorMode(IN UINT uMode)
Definition: except.c:751
BOOL NTAPI IsBadStringPtrW(IN LPCWSTR lpsz, IN UINT_PTR ucchMax)
Definition: except.c:950
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
Definition: proc.c:1166
VOID WINAPI ExitProcess(IN UINT uExitCode)
Definition: proc.c:1331
LPVOID WINAPI TlsGetValue(IN DWORD Index)
Definition: thread.c:1240
BOOL WINAPI TlsSetValue(IN DWORD Index, IN LPVOID Value)
Definition: thread.c:1276
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
Definition: sync.c:182
DWORD WINAPI DECLSPEC_HOTPATCH TlsAlloc(void)
Definition: thread.c:657
GUID guid
Definition: version.c:147
MonoAssembly int argc
Definition: metahost.c:107
int WINAPIV fprintf(FILE *file, const char *format,...)
Definition: file.c:5549
int CDECL vfprintf(FILE *file, const char *format, va_list valist)
Definition: file.c:5349
int CDECL fflush(FILE *file)
Definition: file.c:1182
int CDECL setvbuf(FILE *file, char *buf, int mode, size_t size)
Definition: file.c:5006
int intptr_t
Definition: corecrt.h:176
#define stdout
#define va_end(v)
Definition: stdarg.h:28
#define va_start(v, l)
Definition: stdarg.h:26
#define _IONBF
Definition: stdio.h:30
_ACRTIMP int __cdecl atoi(const char *)
Definition: string.c:1715
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1592
_ACRTIMP int __cdecl strcmp(const char *, const char *)
Definition: string.c:3319
_ACRTIMP int __cdecl strncmp(const char *, const char *, size_t)
Definition: string.c:3330
_ACRTIMP char *__cdecl strrchr(const char *, int)
Definition: string.c:3298
char * va_list
Definition: vadefs.h:50
unsigned char
Definition: typeof.h:29
static const char * debugstr_variant(const VARIANT *var)
Definition: dom.c:505
static LPSTR get_temp_buffer(void)
Definition: dplayx.c:88
return ret
Definition: mutex.c:146
int main()
Definition: test.c:6
POINTL point
Definition: edittest.c:50
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
time_t now
Definition: finger.c:65
#define printf
Definition: freeldr.h:104
const GLdouble * v
Definition: gl.h:2040
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLdouble s
Definition: gl.h:2039
GLuint GLuint end
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLenum func
Definition: glext.h:6028
GLdouble n
Definition: glext.h:7729
GLuint res
Definition: glext.h:9613
GLsizei const GLchar *const * strings
Definition: glext.h:7622
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
GLenum condition
Definition: glext.h:9255
const GLubyte * c
Definition: glext.h:8905
GLuint index
Definition: glext.h:6031
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLenum GLenum dst
Definition: glext.h:6340
GLbitfield flags
Definition: glext.h:7161
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
int hex(char ch)
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_wn
Definition: kernel32.h:33
#define debugstr_w
Definition: kernel32.h:32
#define wine_dbgstr_w
Definition: kernel32.h:34
LONG winetest_get_successes(void)
void winetest_end_nocount(void)
void winetest_start_nocount(unsigned int flags)
int winetest_loop_nocount(void)
static PVOID ptr
Definition: dispmode.c:27
#define sprintf
Definition: sprintf.c:45
const char * var
Definition: shader.c:5666
static UINT exit_code
Definition: process.c:80
static va_list valist
Definition: printf.c:46
static int running_under_wine(void)
Definition: main.c:99
#define min(a, b)
Definition: monoChain.cc:55
#define argv
Definition: mplay32.c:18
#define run_test(test)
Definition: ms_seh.c:71
unsigned int UINT
Definition: ndis.h:50
#define SEM_FAILCRITICALERRORS
Definition: rtltypes.h:69
#define SEM_NOGPFAULTERRORBOX
Definition: rtltypes.h:70
#define V_BOOL(A)
Definition: oleauto.h:224
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define V_UI4(A)
Definition: oleauto.h:270
#define LOWORD(l)
Definition: pedump.c:82
long LONG
Definition: pedump.c:60
#define test
Definition: rosglue.h:37
const struct test winetest_testlist[]
Definition: testlist.c:7
#define wine_dbgstr_wn
Definition: testlist.c:2
const WCHAR * str
#define inline
Definition: compat.h:23
strcpy
Definition: string.h:131
const char int int int static __inline const char * wine_dbgstr_a(const char *s)
Definition: debug.h:187
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:206
static const char winetest_color_dark_purple[]
Definition: test.h:212
static void winetest_end_todo(void)
Definition: test.h:505
void void winetest_trace(const char *msg,...) __WINE_PRINTF_ATTR(1
#define __winetest_file_line_prefix
Definition: test.h:224
const char * winetest_platform
LONG winetest_flaky_failures
static void winetest_start_todo(int is_todo)
Definition: test.h:490
static void winetest_subtest(const char *name)
Definition: test.h:274
static void winetest_print_location(const char *msg,...) __WINE_PRINTF_ATTR(1
Definition: test.h:253
static LONG winetest_get_failures(void)
Definition: test.h:560
int winetest_debug
static const char winetest_color_reset[]
Definition: test.h:210
static void winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
Definition: test.h:537
static void winetest_print_context(const char *msgtype)
Definition: test.h:264
void winetest_print_lock(void)
LONG winetest_failures
static int winetest_vok(int condition, const char *msg, va_list args)
Definition: test.h:330
static void winetest_pop_context(void)
Definition: test.h:552
LONG winetest_todo_failures
LONG winetest_muted_todo_successes
int winetest_vprintf(const char *msg, va_list args)
static void winetest_add_failures(LONG new_failures)
Definition: test.h:565
static int winetest_loop_flaky(void)
Definition: test.h:469
static const char winetest_color_blue[]
Definition: test.h:215
#define ARRAY_SIZE(x)
Definition: test.h:183
void winetest_skip(const char *msg,...) __WINE_PRINTF_ATTR(1
static const char winetest_color_green[]
Definition: test.h:213
static int winetest_printf(const char *msg,...) __WINE_PRINTF_ATTR(1
Definition: test.h:228
static const char * winetest_elapsed(char *buffer)
Definition: test.h:242
void winetest_ok(int condition, const char *msg,...) __WINE_PRINTF_ATTR(2
LONG winetest_successes
static LONG winetest_add_line(void)
Definition: test.h:295
static void winetest_start_flaky(int is_flaky)
Definition: test.h:462
static int winetest_loop_todo(void)
Definition: test.h:497
void static void winetest_win_skip(const char *msg,...) __WINE_PRINTF_ATTR(1
Definition: test.h:435
int winetest_interactive
#define __WINE_PRINTF_ATTR(fmt, args)
Definition: test.h:51
LONG winetest_todo_successes
int winetest_last_time
Definition: test.h:70
void winetest_print_unlock(void)
void void static void winetest_vskip(const char *msg, va_list args)
Definition: test.h:408
int winetest_color
static const char winetest_color_dark_red[]
Definition: test.h:211
int winetest_get_mainargs(char ***pargv)
LONG winetest_skipped
void winetest_wait_child_process(HANDLE process)
LONG winetest_muted_traces
int winetest_mute_threshold
int winetest_platform_is_wine
static const char winetest_color_bright_purple[]
Definition: test.h:217
LONG winetest_muted_skipped
static void winetest_ignore_exceptions(BOOL ignore)
Definition: test.h:281
int winetest_time
int winetest_start_time
static const char winetest_color_bright_red[]
Definition: test.h:216
int winetest_report_success
static void winetest_end_flaky(void)
Definition: test.h:477
static void winetest_set_location(const char *file, int line)
Definition: test.h:193
int winetest_report_flaky
static const char winetest_color_yellow[]
Definition: test.h:214
struct winetest_thread_data * winetest_get_thread_data(void)
int winetest_get_time(void)
static void release_temp_buffer(char *buffer, size_t size)
Definition: debug.c:339
XML_HIDDEN void xmlParserErrors const char const xmlChar const xmlChar * str2
Definition: parser.h:35
XML_HIDDEN void xmlParserErrors const char const xmlChar * str1
Definition: parser.h:35
static char argv0[MAX_PATH]
Definition: shlexec.c:49
& rect
Definition: startmenu.cpp:1413
PEXCEPTION_RECORD ExceptionRecord
Definition: rtltypes.h:200
DWORD ExceptionCode
Definition: compat.h:208
PVOID ExceptionAddress
Definition: compat.h:211
Definition: scsiwmi.h:51
LONG y
Definition: windef.h:130
LONG x
Definition: windef.h:129
Definition: match.c:390
Definition: inflate.c:139
Definition: http.c:7252
char * name
Definition: compiler.c:66
Definition: fci.c:127
Definition: dsound.c:943
Definition: parser.c:49
Definition: name.c:39
Definition: ps.c:97
unsigned int context_count
Definition: test.h:114
unsigned int nocount_level
Definition: test.h:109
char * str_pos
Definition: test.h:111
const char * current_file
Definition: test.h:104
unsigned int todo_level
Definition: test.h:108
unsigned int flaky_level
Definition: test.h:106
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Definition: synch.c:554
HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexA(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCSTR lpName OPTIONAL)
Definition: synch.c:512
#define vsnprintf
Definition: tif_win32.c:406
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint64_t ULONGLONG
Definition: typedefs.h:67
#define WAIT_ABANDONED
Definition: winbase.h:389
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1156
#define WAIT_OBJECT_0
Definition: winbase.h:383
__wchar_t WCHAR
Definition: xmlstorage.h:180
char CHAR
Definition: xmlstorage.h:175
#define const
Definition: zconf.h:233