]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Improve stability of DolphinView tests
authorFrank Reininghaus <frank78ac@googlemail.com>
Thu, 9 Jun 2011 12:41:53 +0000 (14:41 +0200)
committerFrank Reininghaus <frank78ac@googlemail.com>
Thu, 9 Jun 2011 12:41:53 +0000 (14:41 +0200)
1. Fix possible test failure if hidden files are shown initially.
2. Fix possible test failure if a .directory file is created in
the test directory. I think that this fixes the test failure from
http://my.cdash.org/testDetails.php?test=6350151&build=196639

src/tests/dolphinviewtest_allviewmodes.cpp

index 644eb8b17876bedcb48812b06fe2c39a8c0bbd94..3c36d9b0622578f22a0d083f831236898798ce76 100644 (file)
@@ -143,7 +143,12 @@ void DolphinViewTest_AllViewModes::testViewPropertySettings()
     view.setShowPreview(false);
     QVERIFY(!view.showPreview());
 
-    view.setShowHiddenFiles(false);
+    if (view.showHiddenFiles()) {
+        // Changing the "hidden files" setting triggers the dir lister
+        // -> we have to wait until loading the hidden files is finished
+        view.setShowHiddenFiles(false);
+        waitForFinishedPathLoading(&view);
+    }
     QVERIFY(!view.showHiddenFiles());
 
     /** Check that the sort order is correct for different kinds of settings */
@@ -200,7 +205,12 @@ void DolphinViewTest_AllViewModes::testViewPropertySettings()
     view.setShowHiddenFiles(true);
     waitForFinishedPathLoading(&view);
     QVERIFY(view.showHiddenFiles());
-    QCOMPARE(viewItems(&view), QStringList() << ".f" << "a" << "b" << "c" << "d" << "e");
+
+    // Depending on the settings, a .directory file might have been created.
+    // Remove it from the list to get consistent results.
+    QStringList result = viewItems(&view);
+    result.removeAll(".directory");
+    QCOMPARE(result, QStringList() << ".f" << "a" << "b" << "c" << "d" << "e");
 
     // Previews
     view.setShowPreview(true);