From: Frank Reininghaus Date: Thu, 9 Jun 2011 12:41:53 +0000 (+0200) Subject: Improve stability of DolphinView tests X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/91e210ad6ddc1f605ba8028a9d5a0857c28b82ad Improve stability of DolphinView tests 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 --- diff --git a/src/tests/dolphinviewtest_allviewmodes.cpp b/src/tests/dolphinviewtest_allviewmodes.cpp index 644eb8b17..3c36d9b06 100644 --- a/src/tests/dolphinviewtest_allviewmodes.cpp +++ b/src/tests/dolphinviewtest_allviewmodes.cpp @@ -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);