]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/fswatcher/fswatchertest.cpp
building on 10.5
[wxWidgets.git] / tests / fswatcher / fswatchertest.cpp
index afab336aff09e3a5dbad6eca5d9e41e3249fc843..a3fc759dcca2f364fe9c7479728af19166b7098d 100644 (file)
@@ -348,6 +348,21 @@ public:
         CPPUNIT_ASSERT_EQUAL(expected.GetPath(), e->GetPath());
         CPPUNIT_ASSERT_EQUAL(expected.GetNewPath(), e->GetNewPath());
 
+        // Under MSW extra modification events are sometimes reported after a
+        // rename and we just can't get rid of them, so ignore them in this
+        // test if they do happen.
+        if ( e->GetChangeType() == wxFSW_EVENT_RENAME &&
+                m_events.size() == 2 )
+        {
+            const wxFileSystemWatcherEvent* const e2 = m_events.back();
+            if ( e2->GetChangeType() == wxFSW_EVENT_MODIFY &&
+                    e2->GetPath() == e->GetNewPath() )
+            {
+                // This is a modify event for the new file, ignore it.
+                return;
+            }
+        }
+
         WX_ASSERT_EQUAL_MESSAGE
         (
             (
@@ -413,9 +428,9 @@ private:
         CPPUNIT_TEST( TestEventModify );
 
         // MSW implementation doesn't detect file access events currently
-#ifndef __WXMSW__
+#ifndef __WINDOWS__
         CPPUNIT_TEST( TestEventAccess );
-#endif // __WXMSW__
+#endif // __WINDOWS__
 #endif // !wxHAS_KQUEUE
 
         CPPUNIT_TEST( TestNoEventsAfterRemove );