kdecore: stabilize KLocalizedStringTest::testThreads()

while the threads are running the kdelibs4 catalog may or may not get
removed resulting in a race and different results in the functions (if
the catalog is not there there will be no translation but the test
functions expect it to be translated when french translations are
installed)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-07-28 05:15:59 +03:00
parent 3e1e82534a
commit 3f4a16a84e

View file

@ -268,7 +268,6 @@ void KLocalizedStringTest::testThreads()
std::future<void> future4 = std::async(std::launch::async, &KLocalizedStringTest::translateQt, this);
std::future<void> future5 = std::async(std::launch::async, &KLocalizedStringTest::translateQt, this);
std::future<void> future6 = std::async(std::launch::async, &KLocalizedStringTest::translateToFrench, this);
KGlobal::locale()->removeCatalog("kdelibs4");
kDebug() << "Joining all threads";
future1.wait();
future2.wait();