X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/69b554dcccf7582d8e3e93a88c33f6b506ed8ecb..4dfc0ca0c542424eaee4245bd48ba3084c2d28d0:/tests/fswatcher/fswatchertest.cpp diff --git a/tests/fswatcher/fswatchertest.cpp b/tests/fswatcher/fswatchertest.cpp index afab336aff..8840342dc7 100644 --- a/tests/fswatcher/fswatchertest.cpp +++ b/tests/fswatcher/fswatchertest.cpp @@ -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 ( (