shell32/tests: Fix ITEMIDLIST_format test when running on FAT filesystems

Austin Lund austin.lund at gmail.com
Thu Nov 26 01:03:25 CST 2009


-------------- next part --------------
From 7aa9276788c564737a0e6bf4db8f4182d9541691 Mon Sep 17 00:00:00 2001
From: Austin Lund <austin.lund at gmail.com>
Date: Sat, 21 Nov 2009 09:02:32 +1000
Subject: [PATCH] shell32/tests: Fix ITEMIDLIST_format test when running on FAT filesystems

---
 dlls/shell32/tests/shlfolder.c |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c
index ed3a8b5..d2d54e9 100644
--- a/dlls/shell32/tests/shlfolder.c
+++ b/dlls/shell32/tests/shlfolder.c
@@ -1524,9 +1524,23 @@ static void test_ITEMIDLIST_format(void) {
                     pFileStructA->uFileTime == pFileStructW->uTime,
                     "Last write time should match creation time!\n");
 
-                ok (pFileStructA->uFileDate == pFileStructW->uDate2 &&
-                    pFileStructA->uFileTime == pFileStructW->uTime2,
-                    "Last write time should match last access time!\n");
+                /* On FAT filesystems the last access time is midnight
+                   local time, so the values of uDate2 and uTime2 will
+                   depend on the local timezone.  If the times are exactly
+                   equal then the dates should be identical for both FAT
+                   and NTFS as no timezone is more than 1 day away from UTC.
+                */
+                if (pFileStructA->uFileTime == pFileStructW->uTime2)
+                {
+                    ok (pFileStructA->uFileDate == pFileStructW->uDate2,
+                        "Last write date and time should match last access date and time!\n");
+                }
+                else
+                {
+                    /* TODO: Filesystem may be FAT.  Check date within 1 day
+                       and seconds are zero.*/
+                    skip ("Skipping atime test. Filesystem may be FAT.\n");
+                }
 
                 ok (!lstrcmpW(wszFile[i], pFileStructW->wszName) ||
                     !lstrcmpW(wszFile[i], (WCHAR *)(pFileStructW->abFooBar2 + 22)), /* Vista */
-- 
1.6.3.3


More information about the wine-patches mailing list