winetest: try to make it run on Win95

Ferenc Wagner wferi at afavant.elte.hu
Wed Jun 30 21:33:59 CDT 2004


ChangeLog:
- dlls/mapi32/tests/prop.c: avoid segfaults on uninitialized data.
- dlls/user/tests/win.c: stop killing the desktop, it breaks Win95.
- programs/winetest/main.c: suppress some more error message boxes.
- programs/winetest/send.c: truncate report file if too big.

The win.c modification is crude as I can't be sure if it
will really fix the problem.  Still, omitting one test is
worth having some people running automated tests on Win95.

Feri.

Index: dlls/mapi32/tests/prop.c
===================================================================
RCS file: /home/wine/wine/dlls/mapi32/tests/prop.c,v
retrieving revision 1.2
diff -u -r1.2 prop.c
--- dlls/mapi32/tests/prop.c	3 May 2004 20:19:00 -0000	1.2
+++ dlls/mapi32/tests/prop.c	1 Jul 2004 02:21:29 -0000
@@ -812,7 +812,7 @@
        pvProp.ulPropTag, buffer + sizeof(SPropValue) + sizeof(char*),
        szTestA, sizeof(SPropValue) + sizeof(char*) + 5, sc, 
        lpResProp->Value.MVszA.cValues, lpResProp->ulPropTag,
-       lpResProp->Value.MVszA.lppszA[0], lpResProp->Value.MVszA.lppszA[0], ulCount);
+       lpResProp->Value.MVszA.lppszA[0], sc==S_OK?lpResProp->Value.MVszA.lppszA[0]:NULL, ulCount);
 
     memcpy(buffer2, buffer, sizeof(buffer));
     
@@ -838,7 +838,7 @@
        pvProp.ulPropTag, buffer2 + sizeof(SPropValue) + sizeof(char*),
        szTestA, sizeof(SPropValue) + sizeof(char*) + 5, sc, 
        lpResProp->Value.MVszA.cValues, lpResProp->ulPropTag,
-       lpResProp->Value.MVszA.lppszA[0], lpResProp->Value.MVszA.lppszA[0], ulCount);
+       lpResProp->Value.MVszA.lppszA[0], sc==S_OK?lpResProp->Value.MVszA.lppszA[0]:NULL, ulCount);
 
     /* Native crashes with lpNew or lpOld set to NULL so skip testing this */   
 }
Index: dlls/user/tests/win.c
===================================================================
RCS file: /home/wine/wine/dlls/user/tests/win.c,v
retrieving revision 1.30
diff -u -r1.30 win.c
--- dlls/user/tests/win.c	17 Jun 2004 23:00:40 -0000	1.30
+++ dlls/user/tests/win.c	1 Jul 2004 02:21:29 -0000
@@ -824,6 +824,8 @@
         /* passes on Win XP, but not on Win98
         ok(error==ERROR_ACCESS_DENIED, "ERROR_ACCESS_DENIED after DestroyWindow(shellWindow)\n"); */
 
+        ok(0, "This test kills the Win95 desktop.  FIXME!\n");
+        if (0) {
         /* close old shell instance */
         GetWindowThreadProcessId(shellWindow, &pid);
         hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
@@ -831,6 +833,7 @@
         ok(ret, "termination of previous shell process failed: GetLastError()=%ld\n", GetLastError());
         WaitForSingleObject(hProcess, INFINITE);    /* wait for termination */
         CloseHandle(hProcess);
+        }
     }
 
     hwnd1 = CreateWindowEx(0, TEXT("#32770"), TEXT("TEST1"), WS_OVERLAPPEDWINDOW/*|WS_VISIBLE*/, 100, 100, 300, 200, 0, 0, hinst, 0);
Index: programs/winetest/main.c
===================================================================
RCS file: /home/wine/wine/programs/winetest/main.c,v
retrieving revision 1.19
diff -u -r1.19 main.c
--- programs/winetest/main.c	15 Jun 2004 22:45:15 -0000	1.19
+++ programs/winetest/main.c	1 Jul 2004 02:21:29 -0000
@@ -411,7 +411,7 @@
     char *strres, *eol, *nextline;
     DWORD strsize;
 
-    SetErrorMode (SEM_NOGPFAULTERRORBOX);
+    SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
 
     if (!logname) {
         logname = tempnam (0, "res");
Index: programs/winetest/send.c
===================================================================
RCS file: /home/wine/wine/programs/winetest/send.c,v
retrieving revision 1.11
diff -u -r1.11 send.c
--- programs/winetest/send.c	15 Jun 2004 22:45:15 -0000	1.11
+++ programs/winetest/send.c	1 Jul 2004 02:21:29 -0000
@@ -140,9 +140,9 @@
     filesize = ftell (f);
     if (filesize > 1024*1024) {
         report (R_WARNING,
-                "File too big (%d > 1 MB), copy and submit manually",
-                filesize);
-        goto abort2;
+                "File too big (%.1f MB > 1 MB); submitting partial report.",
+                filesize/1024.0/1024);
+        filesize = 1024*1024;
     }
     fseek (f, 0, SEEK_SET);
 
@@ -159,7 +159,14 @@
 
     report (R_STATUS, "Sending %u bytes of data", filesize);
     report (R_PROGRESS, 2, filesize);
-    while ((bytes_read = fread (buffer, 1, BUFLEN / 2, f))) {
+    total = 0;
+    while (total < filesize && (bytes_read = fread (buffer, 1, BUFLEN/2, f))) {
+        if ((signed)bytes_read == -1) {
+            report (R_WARNING, "Error reading log file: %d", errno);
+            goto abort2;
+        }
+        total += bytes_read;
+        if (total > filesize) bytes_read -= total - filesize;
         if (send_buf (s, buffer, bytes_read)) {
             report (R_WARNING, "Error sending body: %d, %d",
                     errno, WSAGetLastError ());



More information about the wine-patches mailing list