diff -r 2b40d63a9c3d -r 90517678cc4f qtmobility/tests/auto/qvaluespacepublisher/tst_qvaluespacepublisher.cpp --- a/qtmobility/tests/auto/qvaluespacepublisher/tst_qvaluespacepublisher.cpp Fri Apr 16 15:51:22 2010 +0300 +++ b/qtmobility/tests/auto/qvaluespacepublisher/tst_qvaluespacepublisher.cpp Mon May 03 13:18:40 2010 +0300 @@ -56,6 +56,8 @@ #include #endif +#include + #define QTRY_COMPARE(a,e) \ for (int _i = 0; _i < 5000; _i += 100) { \ if ((a) == (e)) break; \ @@ -132,6 +134,13 @@ #endif QValueSpace::initValueSpaceServer(); + + if (QValueSpace::availableLayers().contains(QVALUESPACE_GCONF_LAYER)) { + QCOMPARE(QProcess::execute("gconftool-2 -u /value"), 0); + QCOMPARE(QProcess::execute("gconftool-2 -u /testConstructor/value"), 0); + QCOMPARE(QProcess::execute("gconftool-2 -u /testConstructor/subpath/value"), 0); + } + } void tst_QValueSpacePublisher::cleanupTestCase() @@ -474,12 +483,18 @@ QList layers = QValueSpaceManager::instance()->getLayers(); + int foundLayers = 0; for (int i = 0; i < layers.count(); ++i) { QAbstractValueSpaceLayer *layer = layers.at(i); if (layer->id() == QVALUESPACE_NONVOLATILEREGISTRY_LAYER) continue; + //GConfLayer can't provide thread-safety because it eventually depends on + //DBus which isn't fully thread-safe + if (layer->id() == QVALUESPACE_GCONF_LAYER) + continue; + #ifdef Q_OS_WINCE // Limit number of items on Windows CE to prevent out of disk space errors. if (layer->id() == QVALUESPACE_VOLATILEREGISTRY_LAYER) { @@ -571,7 +586,11 @@ QTest::newRow("100 threads, 100 items") << layer->id() << uint(100) << uint(100) << false; } + foundLayers++; } + + if (foundLayers == 0) + QSKIP("No layers providing thread-safety found", SkipAll); } void tst_QValueSpacePublisher::threads() @@ -581,6 +600,9 @@ QFETCH(unsigned int, count); QFETCH(bool, sequential); + if (QValueSpace::availableLayers().contains(QVALUESPACE_GCONF_LAYER)) { + QCOMPARE(QProcess::execute("gconftool-2 --recursive-unset /threads"), 0); + } QStringList expectedPaths; for (unsigned int i = 0; i < threads; ++i) expectedPaths.append(QString("thread%1").arg(i));