]> git.saurik.com Git - wxWidgets.git/commitdiff
Give more informative error in wxFSW test.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 22 Oct 2009 23:54:55 +0000 (23:54 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 22 Oct 2009 23:54:55 +0000 (23:54 +0000)
Output more details when more than one event is unexpectedly received.
Hopefully this will allow to debug the test failure at build bot slaves which
doesn't seem to be happening locally.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62482 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

tests/fswatcher/fswatchertest.cpp

index 80fea6d5e8601ca3d32bb416863a47b19ebcef2c..306049f73e7954c64bc87ea4cc029f8b646ff9bc 100644 (file)
@@ -327,7 +327,18 @@ public:
 
     virtual bool CheckResult()
     {
-        CPPUNIT_ASSERT_EQUAL( 1, m_events.size() );
+        CPPUNIT_ASSERT_MESSAGE( "No events received", !m_events.empty() );
+
+        WX_ASSERT_EQUAL_MESSAGE
+        (
+            (
+                "Extra event received, last has type=%x, path=\"%s\"",
+                m_events.back()->GetChangeType(),
+                m_events.back()->GetPath().GetFullPath()
+            ),
+            1, m_events.size()
+        );
+
         const wxFileSystemWatcherEvent * const e = m_events.front();
 
         // this is our "reference event"
@@ -342,7 +353,6 @@ public:
 
         CPPUNIT_ASSERT_EQUAL(expected.GetPath(), e->GetPath());
         CPPUNIT_ASSERT_EQUAL(expected.GetNewPath(), e->GetNewPath());
-        CPPUNIT_ASSERT_EQUAL(expected.GetChangeType(), e->GetChangeType());
 
         return true;
     }