>From ef999168e2689347c25470a784c88bd71def7630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20R=C3=B8nne?= Date: Mon, 23 Aug 2010 22:05:41 +0200 Subject: [PATCH 4/6] Updated test include file for DOS test program building Updated wine's main test include file, to omit/include changes needed to build DOS 16 bit programs the same way 32 bit test program are build. --- include/wine/test.h | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/include/wine/test.h b/include/wine/test.h index 1a98025..2026556 100644 --- a/include/wine/test.h +++ b/include/wine/test.h @@ -23,8 +23,10 @@ #include #include +#ifndef __WINE_WINE_DOS16_TEST_H #include #include +#endif #ifdef __WINE_CONFIG_H #error config.h should not be used in Wine tests @@ -60,7 +62,9 @@ extern void winetest_start_todo( const char* platform ); extern int winetest_loop_todo(void); extern void winetest_end_todo( const char* platform ); extern int winetest_get_mainargs( char*** pargv ); +#ifndef __WINE_WINE_DOS16_TEST_H extern void winetest_wait_child_process( HANDLE process ); +#endif extern const char *wine_dbgstr_wn( const WCHAR *str, int n ); static inline const char *wine_dbgstr_w( const WCHAR *s ) { return wine_dbgstr_wn( s, -1 ); } @@ -228,6 +232,19 @@ typedef struct } tls_data; static DWORD tls_index; +#ifdef __WINE_WINE_DOS16_TEST_H +/* DOS doesn't run threaded, so we just keep one global tls_data */ +tls_data dos_tls; +static int tls_init = 0; +static tls_data* get_tls_data(void) +{ + if(!tls_init) { + dos_tls.str_pos = dos_tls.strings; + tls_init = 1; + } + return &dos_tls; +} +#else static tls_data* get_tls_data(void) { tls_data* data; @@ -244,6 +261,7 @@ static tls_data* get_tls_data(void) SetLastError(last_error); return data; } +#endif /* __WINE_WINE_DOS16_TEST_H */ /* allocate some tmp space for a string */ static char *get_temp_buffer( size_t n ) @@ -427,6 +445,7 @@ int winetest_get_mainargs( char*** pargv ) return winetest_argc; } +#ifndef __WINE_WINE_DOS16_TEST_H void winetest_wait_child_process( HANDLE process ) { DWORD exit_code = 1; @@ -452,6 +471,7 @@ void winetest_wait_child_process( HANDLE process ) } } } +#endif /* __WINE_WINE_DOS16_TEST_H */ const char *wine_dbgstr_wn( const WCHAR *str, int n ) { @@ -557,7 +577,11 @@ static int run_test( const char *name ) if (winetest_debug) { +#ifndef __WINE_WINE_DOS16_TEST_H fprintf( stdout, "%s: %d tests executed (%d marked as todo, %d %s), %d skipped.\n", +#else + fprintf( stdout, "%s: %ld tests executed (%ld marked as todo, %ld %s), %ld skipped.\n", +#endif test->name, successes + failures + todo_successes + todo_failures, todo_successes, failures + todo_failures, (failures + todo_failures != 1) ? "failures" : "failure", @@ -576,6 +600,7 @@ static void usage( const char *argv0 ) exit_process(1); } +#ifndef __WINE_WINE_DOS16_TEST_H /* trap unhandled exceptions */ static LONG CALLBACK exc_filter( EXCEPTION_POINTERS *ptrs ) { @@ -589,6 +614,7 @@ static LONG CALLBACK exc_filter( EXCEPTION_POINTERS *ptrs ) fflush( stdout ); return EXCEPTION_EXECUTE_HANDLER; } +#endif /* __WINE_WINE_DOS16_TEST_H */ void _fpreset(void) {} /* override the mingw fpu init code */ @@ -607,8 +633,10 @@ int main( int argc, char **argv ) if (GetEnvironmentVariableA( "WINETEST_INTERACTIVE", p, sizeof(p) )) winetest_interactive = atoi(p); if (GetEnvironmentVariableA( "WINETEST_REPORT_SUCCESS", p, sizeof(p) )) report_success = atoi(p); +#ifndef __WINE_WINE_DOS16_TEST_H if (!strcmp( winetest_platform, "windows" )) SetUnhandledExceptionFilter( exc_filter ); if (!winetest_interactive) SetErrorMode( SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX ); +#endif if (!argv[1]) { -- 1.7.0.4