summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2013-04-05 15:07:50 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-05 15:21:12 +0200
commit84102e1eaf19ede040444fb458a2fc23ecefb3d4 (patch)
treea54a3eeda661ddb69efbff710a7e116df2ad6f42
parent441abbedd823ee7dc9e60fefbcbd0b6489ceeee2 (diff)
downloadqtxmlpatterns-84102e1eaf19ede040444fb458a2fc23ecefb3d4.tar.gz
XmlPatterns-Testsuite: Use GLOBAL_STATIC for network access manager.
Do not use global static variable, this causes warnings and hangs on Windows. Change-Id: Ic31c347b69ae7e97699a351834d34f7eda6695e2 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
-rw-r--r--tests/auto/xmlpatternssdk/TestSuiteHandler.cpp4
-rw-r--r--tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/xmlpatternssdk/TestSuiteHandler.cpp b/tests/auto/xmlpatternssdk/TestSuiteHandler.cpp
index 3f92297..e7423d1 100644
--- a/tests/auto/xmlpatternssdk/TestSuiteHandler.cpp
+++ b/tests/auto/xmlpatternssdk/TestSuiteHandler.cpp
@@ -52,7 +52,7 @@
using namespace QPatternistSDK;
-QNetworkAccessManager s_networkManager;
+Q_GLOBAL_STATIC(QNetworkAccessManager, networkAccessManager)
TestSuiteHandler::TestSuiteHandler(const QUrl &catalogFile,
const bool useEList) : m_ts(0)
@@ -275,7 +275,7 @@ bool TestSuiteHandler::endElement(const QString &namespaceURI,
}
else if(localName == QLatin1String("sources"))
{
- const QPatternist::NetworkAccessDelegator::Ptr networkDelegator(new QPatternist::NetworkAccessDelegator(&s_networkManager, &s_networkManager));
+ const QPatternist::NetworkAccessDelegator::Ptr networkDelegator(new QPatternist::NetworkAccessDelegator(networkAccessManager(), networkAccessManager()));
m_resourceLoader = QPatternist::ResourceLoader::Ptr(new QPatternist::AccelTreeResourceLoader(Global::namePool(),
networkDelegator));
diff --git a/tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.cpp b/tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.cpp
index b487482..080ffac 100644
--- a/tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.cpp
+++ b/tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.cpp
@@ -52,7 +52,7 @@
using namespace QPatternistSDK;
-extern QNetworkAccessManager s_networkManager;
+Q_GLOBAL_STATIC(QNetworkAccessManager, networkAccessManager)
XSLTTestSuiteHandler::XSLTTestSuiteHandler(const QUrl &catalogFile) : m_ts(0)
, m_tc(0)
@@ -60,7 +60,7 @@ XSLTTestSuiteHandler::XSLTTestSuiteHandler(const QUrl &catalogFile) : m_ts(0)
, m_catalogFile(catalogFile)
, m_removeTestcase(false)
{
- const QPatternist::NetworkAccessDelegator::Ptr networkDelegator(new QPatternist::NetworkAccessDelegator(&s_networkManager, &s_networkManager));
+ const QPatternist::NetworkAccessDelegator::Ptr networkDelegator(new QPatternist::NetworkAccessDelegator(networkAccessManager(), networkAccessManager()));
m_resourceLoader = QPatternist::ResourceLoader::Ptr(new QPatternist::AccelTreeResourceLoader(Global::namePool(),
networkDelegator));