Allow more failure when testing kernel/test/drive.c

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Allow more failure when testing kernel/test/drive.c

Uwe Bonnes

For me, following setup leads to a failure in dlls/kernel/tests/drive.c when
no floppy is inserted into the drive

> ls -l ~/.wine/dosdevices/a:
lrwxrwxrwx  1 bon users 13 2005-05-23 23:18 /home/bon/.wine/dosdevices/a: ->
/media/floppy
> cat /proc/mounts |grep  /media/floppy
/dev/fd0 /media/floppy subfs rw,sync,nosuid,nodev 0 0

Appended patch doesn't poke around with the drive, if it is not mounted and
lets the test succeed.

Bye
--
Uwe Bonnes                [hidden email]

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Index: wine/dlls/kernel/tests/drive.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/tests/drive.c,v
retrieving revision 1.5
diff -u -r1.5 drive.c
--- wine/dlls/kernel/tests/drive.c 31 May 2005 09:30:46 -0000 1.5
+++ wine/dlls/kernel/tests/drive.c 8 Jun 2005 19:27:00 -0000
@@ -102,10 +102,11 @@
 
     for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++)
     {
+        UINT drivetype = GetDriveTypeA(drive);
         /* Skip floppy drives because NT pops up a MessageBox if no
          * floppy is present
          */
-        if (GetDriveTypeA(drive)!=DRIVE_REMOVABLE)
+        if (drivetype != DRIVE_REMOVABLE && drivetype != DRIVE_NO_ROOT_DIR)
         {
             ret = GetDiskFreeSpaceA(drive, &sectors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters);
             if (!(logical_drives & 1))
@@ -156,8 +157,9 @@
 
     for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++)
     {
+ UINT drivetype = GetDriveTypeW(drive);
         /* Skip floppy drives because NT4 pops up a MessageBox if no floppy is present */
-        if (GetDriveTypeW(drive)!=DRIVE_REMOVABLE)
+        if (drivetype != DRIVE_REMOVABLE && drivetype != DRIVE_NO_ROOT_DIR)
         {
             ret = GetDiskFreeSpaceW(drive, &sectors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters);
             if (!(logical_drives & 1))