[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kdecore/tests
From:       David Faure <faure () kde ! org>
Date:       2011-01-17 0:11:51
Message-ID: 20110117001151.68855AC8B5 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1214949 by dfaure:

output which backend is used


 M  +20 -1     kdirwatch_unittest.cpp  


--- trunk/KDE/kdelibs/kdecore/tests/kdirwatch_unittest.cpp #1214948:1214949
@@ -36,6 +36,24 @@
 
 // Note that kdirlistertest and kdirmodeltest also exercise KDirWatch quite a lot.
 
+static const char* methodToString(KDirWatch::Method method)
+{
+    switch (method) {
+    case KDirWatch::FAM:
+        return "Fam";
+    case KDirWatch::INotify:
+        return "INotify";
+    case KDirWatch::DNotify:
+        return "DNotify";
+    case KDirWatch::Stat:
+        return "Stat";
+    case KDirWatch::QFSWatch:
+        return "QFSWatch";
+    default:
+        return "ERROR!";
+    }
+}
+
 class KDirWatch_UnitTest : public QObject
 {
     Q_OBJECT
@@ -45,7 +63,6 @@
         m_path = m_tempDir.name();
         Q_ASSERT(m_path.endsWith('/'));
 
-        // Speed up the test by making the kdirwatch timer (to compress changes) faster
         KConfigGroup config(KGlobal::config(), "DirWatch");
         const QByteArray testMethod = qgetenv("KDIRWATCHTEST_METHOD");
         if (!testMethod.isEmpty()) {
@@ -53,10 +70,12 @@
         } else {
             config.deleteEntry("PreferredMethod");
         }
+        // Speed up the test by making the kdirwatch timer (to compress changes) faster
         config.writeEntry("PollInterval", 50);
 
         KDirWatch foo;
         m_slow = (foo.internalMethod() == KDirWatch::FAM || foo.internalMethod() == KDirWatch::Stat);
+        kDebug() << "Using method" << methodToString(foo.internalMethod());
     }
 
 private Q_SLOTS: // test methods
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic