From 84102e1eaf19ede040444fb458a2fc23ecefb3d4 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 5 Apr 2013 15:07:50 +0200 Subject: 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 --- tests/auto/xmlpatternssdk/TestSuiteHandler.cpp | 4 ++-- tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.cpp | 4 ++-- 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)); -- cgit v1.2.3