enhancing the winetest framework

Eric Pouech eric.pouech at wanadoo.fr
Thu Apr 18 11:47:51 CDT 2002


this patch lets a test access the argc/argv pair if needed
A+
-------------- next part --------------
Name:          test_arg
ChangeLog:     now C tests are able to access argc/argv as passed to the program
License:       X11
GenDate:       2002/04/18 16:42:07 UTC
ModifiedFiles: programs/winetest/wtmain.c include/wine/test.h
AddedFiles:    
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/programs/winetest/wtmain.c,v
retrieving revision 1.5
diff -u -u -r1.5 wtmain.c
--- programs/winetest/wtmain.c	2 Apr 2002 00:44:17 -0000	1.5
+++ programs/winetest/wtmain.c	2 Apr 2002 06:07:48 -0000
@@ -32,6 +32,10 @@
 /* current platform */
 const char *winetest_platform = "windows";
 
+/* passing arguments around */
+static int winetest_argc;
+static char** winetest_argv;
+
 struct test
 {
     const char  *name;
@@ -183,6 +187,12 @@
     }
 }
 
+int winetest_get_mainargs( char*** pargv )
+{
+    *pargv = winetest_argv;
+    return winetest_argc;
+}
+
 /* Find a test by name */
 static const struct test *find_test( const char *name )
 {
@@ -235,6 +245,9 @@
 int main( int argc, char **argv )
 {
     char *p;
+
+    winetest_argc = argc;
+    winetest_argv = argv;
 
     if ((p = getenv( "WINETEST_PLATFORM" ))) winetest_platform = p;
     if ((p = getenv( "WINETEST_DEBUG" ))) winetest_debug = atoi(p);
Index: include/wine/test.h
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/include/wine/test.h,v
retrieving revision 1.3
diff -u -u -r1.3 test.h
--- include/wine/test.h	22 Mar 2002 00:58:00 -0000	1.3
+++ include/wine/test.h	30 Mar 2002 06:50:53 -0000
@@ -38,6 +38,7 @@
 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 );
 
 #define START_TEST(name) void func_##name(void)
 


More information about the wine-patches mailing list