X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=tests%2Fauto%2Fqxmlquery%2Ftst_qxmlquery.cpp;h=1b5d424a8e2ed51443c5b5f107fa81cd30a7dff0;hb=c1623a0d42c9869e5a1d04081e7660722a863de5;hp=241a43a7cfd34a74f949bd331c7fd0e60fd792d5;hpb=694ba70a5bf6ea042cc8d6f8cda4fa6b3f9ea26e;p=profile%2Fivi%2Fqtxmlpatterns.git diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp index 241a43a..1b5d424 100644 --- a/tests/auto/qxmlquery/tst_qxmlquery.cpp +++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp @@ -1,8 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -63,12 +63,7 @@ #include "TestFundament.h" #include "../network-settings.h" -#if defined(Q_OS_SYMBIAN) -#define SRCDIR "" -#define XMLPATTERNSDIR "xmlpatterns" -#else #define XMLPATTERNSDIR SRCDIR "../xmlpatterns" -#endif /*! \class tst_QXmlQuery @@ -96,6 +91,7 @@ public: } private Q_SLOTS: + void initTestCase(); void defaultConstructor() const; void copyConstructor() const; void constructorQXmlNamePool() const; @@ -257,6 +253,11 @@ private: const bool m_testNetwork; }; +void tst_QXmlQuery::initTestCase() +{ + QVERIFY(QtNetworkSettings::verifyTestNetworkSettings()); +} + void tst_QXmlQuery::checkBaseURI(const QUrl &baseURI, const QString &candidate) { /* The use of QFileInfo::canonicalFilePath() takes into account that drive letters @@ -1727,7 +1728,7 @@ void tst_QXmlQuery::messageXML() const query.setQuery(QLatin1String("1basicSyntaxError")); - const QRegExp removeFilename(QLatin1String("Location: file:.*\\#")); + QRegExp removeFilename(QLatin1String("Location: file:.*\\#")); QVERIFY(removeFilename.isValid()); QVERIFY(messageValidator.success()); @@ -2874,7 +2875,15 @@ void tst_QXmlQuery::useUriResolver() const const QUrl &baseURI) const { Q_UNUSED(relative); - return baseURI.resolved(inputFile(QLatin1String(queriesDirectory) + QLatin1String("simpleDocument.xml"))); + QString fixedInputFile = inputFile(QLatin1String(queriesDirectory) + QLatin1String("simpleDocument.xml")); +#ifdef Q_OS_WIN + // A file path with drive letter is not a valid relative URI, so remove the drive letter. + // Note that can't just use inputFileAsURI() instead of inputFile() as that doesn't + // produce a relative URI either. + if (fixedInputFile.size() > 1 && fixedInputFile.at(1) == QLatin1Char(':')) + fixedInputFile.remove(0, 2); +#endif + return baseURI.resolved(fixedInputFile); } };