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