ReactOS 0.4.17-dev-357-ga8f14ff
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#ifdef __REACTOS__
583#include <oleauto.h>
584#endif
585
586struct test
587{
588 const char *name;
589 void (*func)(void);
590};
591
592#ifdef __REACTOS__
593extern const struct test winetest_testlist_start[];
594const struct test* winetest_testlist = &winetest_testlist_start[1];
595#else
596extern const struct test winetest_testlist[];
597#endif
598
599/* debug level */
600int winetest_debug = 1;
601
602/* trace timing information */
603int winetest_time = 0;
605
606/* interactive mode? */
608
609/* current platform */
610const char *winetest_platform = "windows";
612
613/* report failed flaky tests as failures (BOOL) */
615
616/* report successful tests (BOOL) */
618
619/* silence todos and skips above this threshold */
621
622/* use ANSI escape codes for output coloring */
623int winetest_color = 0;
624
625static HANDLE winetest_mutex;
626
627/* passing arguments around */
628static int winetest_argc;
629static char** winetest_argv;
630
631static const struct test *current_test; /* test currently being run */
632
633LONG winetest_successes = 0; /* number of successful tests */
634LONG winetest_failures = 0; /* number of failures */
635LONG winetest_flaky_failures = 0; /* number of failures inside flaky block */
636LONG winetest_skipped = 0; /* number of skipped test chunks */
637LONG winetest_todo_successes = 0; /* number of successful tests inside todo block */
638LONG winetest_todo_failures = 0; /* number of failures inside todo block */
639LONG winetest_muted_traces = 0; /* number of silenced traces */
640LONG winetest_muted_skipped = 0; /* same as skipped but silent */
641LONG winetest_muted_todo_successes = 0; /* same as todo_successes but silent */
642
643static DWORD tls_index;
644
646{
649
651 data=(struct winetest_thread_data*)TlsGetValue(tls_index);
652 if (!data)
653 {
655 data->str_pos = data->strings;
656 TlsSetValue(tls_index,data);
657 }
659 return data;
660}
661
662static void exit_process( int code )
663{
664 fflush( stdout );
665 ExitProcess( code );
666}
667
668void winetest_print_lock(void)
669{
670 UINT ret;
671
672 if (!winetest_mutex) return;
673 ret = WaitForSingleObject( winetest_mutex, 30000 );
674 if (ret != WAIT_OBJECT_0 && ret != WAIT_ABANDONED)
675 {
676 winetest_print_location( "could not get the print lock: %u\n", ret );
677 winetest_mutex = 0;
678 }
679}
680
681void winetest_print_unlock(void)
682{
683 if (winetest_mutex) ReleaseMutex( winetest_mutex );
684}
685
686int winetest_vprintf( const char *msg, va_list args )
687{
689
690 fprintf(stdout, __winetest_file_line_prefix ": ", data->current_file, data->current_line);
691 return vfprintf(stdout, msg, args);
692}
693
694int winetest_get_time(void)
695{
696 return GetTickCount();
697}
698
699int winetest_get_mainargs( char ***pargv )
700{
701 *pargv = winetest_argv;
702 return winetest_argc;
703}
704
706{
707 DWORD exit_code = 1;
708
709 if (WaitForSingleObject( process, 30000 ))
710 fprintf( stdout, "%s: child process wait failed\n", current_test->name );
711 else
713
714 if (exit_code)
715 {
716 if (exit_code > 255)
717 {
718 fprintf( stdout, "%s: exception 0x%08x in child process\n", current_test->name, (unsigned)exit_code );
720 }
721 else
722 {
723 fprintf( stdout, "%s: %u failures in child process\n",
724 current_test->name, (unsigned)exit_code );
725 while (exit_code-- > 0)
727 }
728 }
729}
730
731/* Find a test by name */
732static const struct test *find_test( const char *name )
733{
734 const struct test *test;
735 const char *p;
736 size_t len;
737
738 if ((p = strrchr( name, '/' ))) name = p + 1;
739 if ((p = strrchr( name, '\\' ))) name = p + 1;
740 len = strlen(name);
741 if (len > 2 && !strcmp( name + len - 2, ".c" )) len -= 2;
742
743 for (test = winetest_testlist; test->name; test++)
744 {
745 if (!strncmp( test->name, name, len ) && !test->name[len]) break;
746 }
747 return test->name ? test : NULL;
748}
749
750
751/* Display list of valid tests */
752static void list_tests(void)
753{
754 const struct test *test;
755
756 fprintf( stdout, "Valid test names:\n" );
757 for (test = winetest_testlist; test->name; test++) fprintf( stdout, " %s\n", test->name );
758}
759
760/* Disable false-positive claiming "test" would be NULL-dereferenced */
761#if defined(_MSC_VER)
762#pragma warning(push)
763#pragma warning(disable:28182)
764#endif
765
766/* Run a named test, and return exit status */
767static int run_test( const char *name )
768{
769 const struct test *test;
770 int status;
771
772 if (!(test = find_test( name )))
773 {
774 fprintf( stdout, "Fatal: test '%s' does not exist.\n", name );
775 exit_process(1);
776 }
778 tls_index=TlsAlloc();
779 current_test = test;
780 test->func();
781
782 /* show test results even if traces are disabled */
783 /*if (winetest_debug)*/
784 {
785 fprintf( stdout, "\n%s: %d tests executed (%d marked as todo, %d %s), %d skipped.\n",
788 (winetest_failures + winetest_todo_failures != 1) ? "failures" : "failure",
789 (int)winetest_skipped );
790 }
792 return status;
793}
794
795#if defined(_MSC_VER)
796#pragma warning(pop)
797#endif
798
799/* Display usage and exit */
800static void usage( const char *argv0 )
801{
802 fprintf( stdout, "Usage: %s test_name\n\n", argv0 );
803 list_tests();
804 exit_process(1);
805}
806
807/* trap unhandled exceptions */
808static LONG CALLBACK exc_filter( EXCEPTION_POINTERS *ptrs )
809{
811 char elapsed[64];
812
814 if (data->current_file)
815 printf( "%s:%d: this is the last test seen before the exception\n",
816 data->current_file, data->current_line );
818 printf( "%04x:%s:%s unhandled exception %08x at %p\n",
819 (UINT)GetCurrentProcessId(), current_test->name, winetest_elapsed( elapsed ),
822 fflush( stdout );
825}
826
827/* check if we're running under wine */
828static BOOL running_under_wine(void)
829{
830 HMODULE module = GetModuleHandleA( "ntdll.dll" );
831 if (!module) return FALSE;
832 return (GetProcAddress( module, "wine_server_call" ) != NULL);
833}
834
835/* main function */
836int main( int argc, char **argv )
837{
838 char p[128];
839
840 setvbuf (stdout, NULL, _IONBF, 0);
841 winetest_mutex = CreateMutexA(NULL, FALSE, "winetest_print_mutex");
842
843 winetest_argc = argc;
844 winetest_argv = argv;
845
846 if (GetEnvironmentVariableA( "WINETEST_PLATFORM", p, sizeof(p) )) winetest_platform = _strdup(p);
847 if (GetEnvironmentVariableA( "WINETEST_DEBUG", p, sizeof(p) )) winetest_debug = atoi(p);
848 if (GetEnvironmentVariableA( "WINETEST_INTERACTIVE", p, sizeof(p) )) winetest_interactive = atoi(p);
849 if (GetEnvironmentVariableA( "WINETEST_REPORT_SUCCESS", p, sizeof(p) )) winetest_report_success = atoi(p);
850
852
853 if (!argv[1])
854 {
855 if (winetest_testlist[0].name && !winetest_testlist[1].name) /* only one test */
856 return run_test( winetest_testlist[0].name );
857 usage( argv[0] );
858 }
859 if (!strcmp( argv[1], "--list" ))
860 {
861 list_tests();
862 return 0;
863 }
864 return run_test(argv[1]);
865}
866
867#endif /* STANDALONE */
868
869#ifdef __REACTOS__
870
871// These can go away, once all winetests are synced
872#ifdef NONAMELESSUNION
873# define U(x) (x).u
874# define U1(x) (x).u1
875# define U2(x) (x).u2
876# define U3(x) (x).u3
877# define U4(x) (x).u4
878# define U5(x) (x).u5
879# define U6(x) (x).u6
880# define U7(x) (x).u7
881# define U8(x) (x).u8
882#else
883# define U(x) (x)
884# define U1(x) (x)
885# define U2(x) (x)
886# define U3(x) (x)
887# define U4(x) (x)
888# define U5(x) (x)
889# define U6(x) (x)
890# define U7(x) (x)
891# define U8(x) (x)
892#endif
893
894#ifdef NONAMELESSSTRUCT
895# define S(x) (x).s
896# define S1(x) (x).s1
897# define S2(x) (x).s2
898# define S3(x) (x).s3
899# define S4(x) (x).s4
900# define S5(x) (x).s5
901#else
902# define S(x) (x)
903# define S1(x) (x)
904# define S2(x) (x)
905# define S3(x) (x)
906# define S4(x) (x)
907# define S5(x) (x)
908#endif
909
910// FIXME: Should include wine/debug.h instead
911extern const char *wine_dbgstr_wn( const WCHAR *str, intptr_t n );
912extern const char *wine_dbgstr_an( const CHAR *str, intptr_t n );
913extern const char *wine_dbgstr_guid( const GUID *guid );
914extern const char *wine_dbgstr_point( const POINT *guid );
915extern const char *wine_dbgstr_size( const SIZE *guid );
916extern const char *wine_dbgstr_rect( const RECT *rect );
917#ifdef WINETEST_USE_DBGSTR_LONGLONG
918extern const char *wine_dbgstr_longlong( ULONGLONG ll );
919#endif
920static inline const char *debugstr_a( const char *s ) { return wine_dbgstr_an( s, -1 ); }
921static inline const char *debugstr_an( const CHAR *s, intptr_t n ) { return wine_dbgstr_an( s, n ); }
922static inline const char *debugstr_w( const WCHAR *s ) { return wine_dbgstr_wn( s, -1 ); }
923static inline const char *debugstr_wn( const WCHAR *s, int n ) { return wine_dbgstr_wn( s, n ); }
924static inline const char *debugstr_guid( const struct _GUID *id ) { return wine_dbgstr_guid(id); }
925static inline const char *wine_dbgstr_a( const char *s ) { return wine_dbgstr_an( s, -1 ); }
926static inline const char *wine_dbgstr_w( const WCHAR *s ) { return wine_dbgstr_wn( s, -1 ); }
927#if defined(__oaidl_h__) && defined(V_VT)
928extern const char *wine_dbgstr_variant(const VARIANT *var);
929static inline const char *debugstr_variant( const VARIANT *v ) { return wine_dbgstr_variant( v ); }
930#endif
931extern const char * __cdecl __wine_dbg_strdup( const char *str );
932
933/* strcmpW is available for tests compiled under Wine, but not in standalone
934 * builds under Windows, so we reimplement it under a different name. */
935static inline int winetest_strcmpW( const WCHAR *str1, const WCHAR *str2 )
936{
937 while (*str1 && (*str1 == *str2)) { str1++; str2++; }
938 return *str1 - *str2;
939}
940
941extern LONG winetest_get_successes(void);
942extern void winetest_print(const char* msg, ...) __WINE_PRINTF_ATTR( 1, 2);
943
944extern void winetest_start_nocount(unsigned int flags);
945extern int winetest_loop_nocount(void);
946extern void winetest_end_nocount(void);
947
948// hack for ntdll winetest (this is defined in excpt.h)
949#undef exception_info
950
951// Some helpful definitions
952
953#define ros_skip_flaky for (winetest_start_nocount(3); \
954 winetest_loop_nocount(); \
955 winetest_end_nocount())
956
957#define disable_success_count for (winetest_start_nocount(1); \
958 winetest_loop_nocount(); \
959 winetest_end_nocount())
960
961#define skip_2k3_crash if (_winver < 0x600) skip("Test skipped, because it crashes on win 2003\n"); else
962#define skip_2k3_fail if (_winver < 0x600) skip("Test skipped, because it fails on win 2003\n"); else
963
964#define ok_hex_(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 " (0x%x), got: 0x%x\n", \
969 #expression, _result, _value); \
970 } while (0)
971#define ok_hex(expression, result) ok_hex_(__FILE__, __LINE__, expression, result)
972
973#define ok_dec_(file, line, expression, result) \
974 do { \
975 int _value = (expression); \
976 int _result = (result); \
977 ok_(file, line)(_value == _result, "Wrong value for '%s', expected: " #result " (%d), got: %d\n", \
978 #expression, _result, _value); \
979 } while (0)
980#define ok_dec(expression, result) ok_dec_(__FILE__, __LINE__, expression, result)
981
982#define ok_ptr_(file, line, expression, result) \
983 do { \
984 const void *_value = (expression); \
985 const void *_result = (result); \
986 ok_(file, line)(_value == _result, "Wrong value for '%s', expected: " #result " (%p), got: %p\n", \
987 #expression, _result, _value); \
988 } while (0)
989#define ok_ptr(expression, result) ok_ptr_(__FILE__, __LINE__, expression, result)
990
991#define ok_size_t_(file, line, expression, result) \
992 do { \
993 size_t _value = (expression); \
994 size_t _result = (result); \
995 ok_(file, line)(_value == _result, "Wrong value for '%s', expected: " #result " (%Ix), got: %Ix\n", \
996 #expression, _result, _value); \
997 } while (0)
998#define ok_size_t(expression, result) ok_size_t_(__FILE__, __LINE__, expression, result)
999
1000#define ok_char(expression, result) ok_hex(expression, result)
1001
1002#define ok_err_(file, line, error) \
1003 ok_(file, line)(GetLastError() == (error), "Wrong last error. Expected " #error ", got 0x%lx\n", GetLastError())
1004#define ok_err(error) ok_err_(__FILE__, __LINE__, error)
1005
1006#define ok_str_(file, line, x, y) \
1007 ok_(file, line)(strcmp(x, y) == 0, "Wrong string. Expected '%s', got '%s'\n", y, x)
1008#define ok_str(x, y) ok_str_(__FILE__, __LINE__, x, y)
1009
1010#define ok_wstr_(file, line, x, y) \
1011 ok_(file, line)(wcscmp(x, y) == 0, "Wrong string. Expected '%S', got '%S'\n", y, x)
1012#define ok_wstr(x, y) ok_wstr_(__FILE__, __LINE__, x, y)
1013
1014#define ok_long(expression, result) ok_hex(expression, result)
1015#define ok_int(expression, result) ok_dec(expression, result)
1016#define ok_int_(file, line, expression, result) ok_dec_(file, line, expression, result)
1017#define ok_ntstatus(status, expected) ok_hex(status, expected)
1018#define ok_hdl ok_ptr
1019
1020#define is_reactos() \
1021 (*(unsigned*)((size_t)0x7FFE0FFC) == 0x8EAC705)
1022
1023/* ReactOS specific extensions, useful for patches */
1024#define KUSER_SHARED_DATA_UMPTR 0x7FFE0000
1025#define GetMajorNTVersion() (*(ULONG*)(KUSER_SHARED_DATA_UMPTR + 0x026C))
1026#define GetMinorNTVersion() (*(ULONG*)(KUSER_SHARED_DATA_UMPTR + 0x0270))
1027#define GetNTVersion() ((GetMajorNTVersion() << 8) | GetMinorNTVersion())
1028#define __REACTOS__WinVer_lt(Ver) ((GetNTVersion() < (Ver)))
1029
1030#ifndef STANDALONE
1031struct test
1032{
1033 const char *name;
1034 void (*func)(void);
1035};
1036#endif
1037
1038/* Section allocation helper for automatic test registration */
1039#if defined(_MSC_VER)
1040 #pragma section(".test$A",long,read)
1041 #define _TESTALLOC(x) __declspec(allocate(x))
1042 #define _PRAGMA_SECTION(x, y, z) __pragma(section(x, y, z))
1043 #define _TESTKEEP(x) const void* keep_##x = &x;
1044#elif defined(__GNUC__)
1045 #define _TESTALLOC(x) __attribute__((used, section(x)))
1046 #define _PRAGMA_SECTION(x, y, z)
1047 #define _TESTKEEP(x)
1048#else
1049 #error Your compiler is not supported.
1050#endif
1051
1052#undef START_TEST
1053#define START_TEST(name) \
1054 EXTERN_C void func_##name(void); \
1055 _PRAGMA_SECTION(_CRT_STRINGIZE(.test$B##name), long, read); \
1056 _TESTALLOC(_CRT_STRINGIZE(.test$B##name)) const struct test winetest_testentry_##name = { #name, func_##name }; \
1057 _TESTKEEP(winetest_testentry_##name) \
1058 EXTERN_C void func_##name(void)
1059
1060#ifdef STANDALONE
1061
1062_TESTALLOC(".test$A") const struct test winetest_testlist_start[] = { { "", 0 } };
1063#define winetest_testlist winetest_testlist_dummy
1064
1066{
1067 return winetest_successes;
1068}
1069
1070void winetest_print(const char* msg, ...)
1071{
1074
1075 fprintf(stdout, __winetest_file_line_prefix ": ", data->current_file, data->current_line);
1078 va_end(valist);
1079}
1080
1081void winetest_start_nocount(unsigned int flags)
1082{
1084
1085 /* The lowest 2 bits of nocount_level specify whether counting of successes
1086 and/or failures is disabled. For each nested level the bits are shifted
1087 left, the new lowest 2 bits are copied from the previous state and ored
1088 with the new mask. This allows nested handling of both states up tp a
1089 level of 16. */
1090 flags |= data->nocount_level & 3;
1091 data->nocount_level = (data->nocount_level << 2) | flags;
1092 data->todo_do_loop = 1;
1093}
1094
1095int winetest_loop_nocount(void)
1096{
1098 int do_loop = data->todo_do_loop;
1099 data->todo_do_loop = 0;
1100 return do_loop;
1101}
1102
1103void winetest_end_nocount(void)
1104{
1106 data->nocount_level >>= 2;
1107}
1108
1109/* allocate some tmp space for a string */
1110static char *get_temp_buffer( size_t n )
1111{
1113 char *res = data->str_pos;
1114
1115 if (res + n >= &data->strings[sizeof(data->strings)]) res = data->strings;
1116 data->str_pos = res + n;
1117 return res;
1118}
1119
1120/* release extra space that we requested in gimme1() */
1121static void release_temp_buffer( char *ptr, size_t size )
1122{
1124 data->str_pos = ptr + size;
1125}
1126
1127const char *wine_dbgstr_an( const CHAR *str, intptr_t n )
1128{
1129 char *dst, *res;
1130 size_t size;
1131
1132 if (!((ULONG_PTR)str >> 16))
1133 {
1134 if (!str) return "(null)";
1135 res = get_temp_buffer( 6 );
1136 sprintf( res, "#%04x", LOWORD(str) );
1137 return res;
1138 }
1139 if (n == -1)
1140 {
1141 const CHAR *end = str;
1142 while (*end) end++;
1143 n = end - str;
1144 }
1145 if (n < 0) n = 0;
1146 size = 12 + min( 300, n * 5 );
1147 dst = res = get_temp_buffer( size );
1148 *dst++ = '"';
1149 while (n-- > 0 && dst <= res + size - 10)
1150 {
1151 CHAR c = *str++;
1152 switch (c)
1153 {
1154 case '\n': *dst++ = '\\'; *dst++ = 'n'; break;
1155 case '\r': *dst++ = '\\'; *dst++ = 'r'; break;
1156 case '\t': *dst++ = '\\'; *dst++ = 't'; break;
1157 case '"': *dst++ = '\\'; *dst++ = '"'; break;
1158 case '\\': *dst++ = '\\'; *dst++ = '\\'; break;
1159 default:
1160 if (c >= ' ' && c <= 126)
1161 *dst++ = (char)c;
1162 else
1163 {
1164 *dst++ = '\\';
1165 sprintf(dst,"%04x",c);
1166 dst+=4;
1167 }
1168 }
1169 }
1170 *dst++ = '"';
1171 if (n > 0)
1172 {
1173 *dst++ = '.';
1174 *dst++ = '.';
1175 *dst++ = '.';
1176 }
1177 *dst++ = 0;
1179 return res;
1180}
1181
1182const char *wine_dbgstr_wn( const WCHAR *str, intptr_t n )
1183{
1184 char *res;
1185 static const char hex[16] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
1186 char buffer[300], *dst = buffer;
1187
1188 if (!str) return "(null)";
1189 if (!((ULONG_PTR)str >> 16))
1190 {
1191 res = get_temp_buffer( 6 );
1192 sprintf( res, "#%04x", LOWORD(str) );
1193 return res;
1194 }
1195 if (IsBadStringPtrW(str,n)) return "(invalid)";
1196 if (n == -1) for (n = 0; str[n]; n++) ;
1197 *dst++ = 'L';
1198 *dst++ = '"';
1199 while (n-- > 0 && dst <= buffer + sizeof(buffer) - 10)
1200 {
1201 WCHAR c = *str++;
1202 switch (c)
1203 {
1204 case '\n': *dst++ = '\\'; *dst++ = 'n'; break;
1205 case '\r': *dst++ = '\\'; *dst++ = 'r'; break;
1206 case '\t': *dst++ = '\\'; *dst++ = 't'; break;
1207 case '"': *dst++ = '\\'; *dst++ = '"'; break;
1208 case '\\': *dst++ = '\\'; *dst++ = '\\'; break;
1209 default:
1210 if (c < ' ' || c >= 127)
1211 {
1212 *dst++ = '\\';
1213 *dst++ = hex[(c >> 12) & 0x0f];
1214 *dst++ = hex[(c >> 8) & 0x0f];
1215 *dst++ = hex[(c >> 4) & 0x0f];
1216 *dst++ = hex[c & 0x0f];
1217 }
1218 else *dst++ = (char)c;
1219 }
1220 }
1221 *dst++ = '"';
1222 if (n > 0)
1223 {
1224 *dst++ = '.';
1225 *dst++ = '.';
1226 *dst++ = '.';
1227 }
1228 *dst = 0;
1229
1231 strcpy(res, buffer);
1232 return res;
1233}
1234
1235const char *wine_dbgstr_guid( const GUID *guid )
1236{
1237 char *res;
1238
1239 if (!guid) return "(null)";
1240 res = get_temp_buffer( 39 ); /* CHARS_IN_GUID */
1241 sprintf( res, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
1242 (unsigned int)guid->Data1, guid->Data2, guid->Data3, guid->Data4[0],
1243 guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4],
1244 guid->Data4[5], guid->Data4[6], guid->Data4[7] );
1245 return res;
1246}
1247
1248const char *wine_dbgstr_point( const POINT *point )
1249{
1250 char *res;
1251
1252 if (!point) return "(null)";
1253 res = get_temp_buffer( 60 );
1254#ifdef __ROS_LONG64__
1255 sprintf( res, "(%d,%d)", point->x, point->y );
1256#else
1257 sprintf( res, "(%ld,%ld)", point->x, point->y );
1258#endif
1260 return res;
1261}
1262
1263const char *wine_dbgstr_size( const SIZE *size )
1264{
1265 char *res;
1266
1267 if (!size) return "(null)";
1268 res = get_temp_buffer( 60 );
1269#ifdef __ROS_LONG64__
1270 sprintf( res, "(%d,%d)", size->cx, size->cy );
1271#else
1272 sprintf( res, "(%ld,%ld)", size->cx, size->cy );
1273#endif
1275 return res;
1276}
1277
1278const char *wine_dbgstr_rect( const RECT *rect )
1279{
1280 char *res;
1281
1282 if (!rect) return "(null)";
1283 res = get_temp_buffer( 60 );
1284#ifdef __ROS_LONG64__
1285 sprintf( res, "(%d,%d)-(%d,%d)", rect->left, rect->top, rect->right, rect->bottom );
1286#else
1287 sprintf( res, "(%ld,%ld)-(%ld,%ld)", rect->left, rect->top, rect->right, rect->bottom );
1288#endif
1290 return res;
1291}
1292
1293#ifdef WINETEST_USE_DBGSTR_LONGLONG
1294const char *wine_dbgstr_longlong( ULONGLONG ll )
1295{
1296 char *res;
1297
1298 res = get_temp_buffer( 20 );
1299 if (/*sizeof(ll) > sizeof(unsigned long) &&*/ ll >> 32) /* ULONGLONG is always > long in ReactOS */
1300 sprintf( res, "%lx%08lx", (unsigned long)(ll >> 32), (unsigned long)ll );
1301 else
1302 sprintf( res, "%lx", (unsigned long)ll );
1304 return res;
1305}
1306#endif
1307
1308#if defined(__oaidl_h__) && defined(V_VT)
1309const char *wine_dbgstr_variant(const VARIANT *var)
1310{
1311 static char buf[400];
1312
1313 if (!var)
1314 return "(null)";
1315
1316 switch (V_VT(var))
1317 {
1318 case VT_EMPTY:
1319 return "{VT_EMPTY}";
1320 case VT_BSTR:
1321 sprintf(buf, "{VT_BSTR: %s}", wine_dbgstr_w(V_BSTR(var)));
1322 break;
1323 case VT_BOOL:
1324 sprintf(buf, "{VT_BOOL: %x}", V_BOOL(var));
1325 break;
1326 case VT_UI4:
1327 sprintf(buf, "{VT_UI4: %u}", V_UI4(var));
1328 break;
1329 default:
1330 sprintf(buf, "{vt %d}", V_VT(var));
1331 break;
1332 }
1333
1334 return buf;
1335}
1336#endif
1337
1338/* FIXME: this is not 100% thread-safe */
1339const char * __cdecl __wine_dbg_strdup( const char *str )
1340{
1341 static char *list[32];
1342 static LONG pos;
1343 char *ret = _strdup( str );
1344 int idx;
1345
1347 free( InterlockedExchangePointer( (void **)&list[idx], ret ));
1348 return ret;
1349}
1350
1351#endif
1352
1353#ifdef __cplusplus
1354} /* extern "C" */
1355#endif
1356
1357#ifdef __GNUC__
1358#pragma GCC diagnostic pop
1359#endif
1360
1361#endif // __REACTOS__
1362
1363#endif /* __WINE_WINE_TEST_H */
ios_base &_STLP_CALL hex(ios_base &__s)
Definition: _ios_base.h:324
#define vsnprintf
Definition: acwin.h:108
#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
Definition: list.h:37
RECT rect
Definition: combotst.c:67
#define free
Definition: debug_ros.c:5
#define _strdup
Definition: debug_ros.c:7
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
unsigned int idx
Definition: utils.c:41
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:1165
VOID WINAPI ExitProcess(IN UINT uExitCode)
Definition: proc.c:1330
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 __cdecl
Definition: corecrt.h:121
#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:1720
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1597
_ACRTIMP int __cdecl strcmp(const char *, const char *)
Definition: string.c:3324
_ACRTIMP int __cdecl strncmp(const char *, const char *, size_t)
Definition: string.c:3335
_ACRTIMP char *__cdecl strrchr(const char *, int)
Definition: string.c:3303
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
#define InterlockedExchangePointer(Target, Value)
Definition: dshow.h:45
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:103
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
#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
short WCHAR
Definition: pedump.c:58
long LONG
Definition: pedump.c:60
char CHAR
Definition: pedump.c:57
#define test
Definition: rosglue.h:37
const struct test winetest_testlist[]
Definition: testlist.c:25
#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:152
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:171
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
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
LONG right
Definition: windef.h:108
LONG bottom
Definition: windef.h:109
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106
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
uint64_t ULONGLONG
Definition: typedefs.h:67
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define WAIT_ABANDONED
Definition: winbase.h:389
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1155
#define WAIT_OBJECT_0
Definition: winbase.h:383
#define const
Definition: zconf.h:233