Skip to content

foldermodeltest: Fix tst_cd()

Fushan Wen requested to merge work/fusionfuture/fix-foldermodeltest into master

KCoreDirLister::completed is emitted twice after entering a cached folder.

  1. The first comes from KCoreDirListerCache::emitItemsFromCache.
  2. The second comes from KCoreDirListerCache::slotUpdateResult.

Add another s.wait(500) to validate the second one.

Also port away from deprecated setAutoErrorHandlingEnabled.

Local test result

> ./build/bin/foldermodeltest 
********* Start testing of FolderModelTest *********
Config: Using QtTest library 5.15.2, Qt 5.15.2 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 11.2.1 20210816 [revision 056e324ce46a7924b5cf10f61010cf9dd2ca10e9]), opensuse-tumbleweed 20211218
PASS   : FolderModelTest::initTestCase()
QWARN  : FolderModelTest::tst_listing() kf.kio.core: Malformed JSON protocol file for protocol: "trash" , number of the ExtraNames fields should match the number of ExtraTypes fields
PASS   : FolderModelTest::tst_listing()
PASS   : FolderModelTest::tst_listingDescending()
PASS   : FolderModelTest::tst_listingFolderNotFirst()
PASS   : FolderModelTest::tst_filterListing()
PASS   : FolderModelTest::tst_cd()
PASS   : FolderModelTest::tst_rename(Folder rename)
PASS   : FolderModelTest::tst_rename(File rename)
XFAIL  : FolderModelTest::tst_rename(Invalid rename) This is expected to fail
   Loc: [/home/qydw/文档/osc/KDE/Plasma/plasma-desktop/containments/desktop/plugins/folder/autotests/foldermodeltest.cpp(159)]
PASS   : FolderModelTest::tst_rename(Invalid rename)
PASS   : FolderModelTest::tst_selection()
PASS   : FolderModelTest::tst_defaultValues()
PASS   : FolderModelTest::tst_actionMenu()
PASS   : FolderModelTest::tst_lockedChanged()
PASS   : FolderModelTest::tst_multiScreen()
PASS   : FolderModelTest::tst_multiScreenDifferenPath()
PASS   : FolderModelTest::cleanupTestCase()
Totals: 16 passed, 0 failed, 0 skipped, 0 blacklisted, 6754ms
********* Finished testing of FolderModelTest *********
Edited by Fushan Wen

Merge request reports