[PATCH 4/6] Updated test include file for DOS test program building
Morten Rønne
morten.roenne at tdcadsl.dk
Mon Aug 23 15:05:41 CDT 2010
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 <stdarg.h>
#include <stdlib.h>
+#ifndef __WINE_WINE_DOS16_TEST_H
#include <windef.h>
#include <winbase.h>
+#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
--------------010804060206000305020908
Content-Type: text/plain;
name="0005-DOS-16-bit-test-include-file.txt"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
filename="0005-DOS-16-bit-test-include-file.txt"
More information about the wine-devel
mailing list