summaryrefslogtreecommitdiffstats
path: root/tests/auto/qxmlquery/tst_qxmlquery.cpp
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2010-07-01 09:12:58 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2010-07-01 09:28:26 (GMT)
commit76274d40569f45cec50ad5df8646e09e40117007 (patch)
tree8b482761590b93fb0fae5081583e50973250a940 /tests/auto/qxmlquery/tst_qxmlquery.cpp
parentb0bbabe728fedb8531fc2837403856bd5ed44e1b (diff)
downloadQt-76274d40569f45cec50ad5df8646e09e40117007.zip
Qt-76274d40569f45cec50ad5df8646e09e40117007.tar.gz
Qt-76274d40569f45cec50ad5df8646e09e40117007.tar.bz2
Fix QXmlQuery autotest on Symbian
Deployment of the test files to ../xmlpatterns resolves to c:/private/xmlpatterns, which is an illegal location to deploy to on symbian. Changed the deployment and test to put the xmlpatterns directory inside the app's private directory on symbian Regression tested on windows build. Reviewed-by: mread
Diffstat (limited to 'tests/auto/qxmlquery/tst_qxmlquery.cpp')
-rw-r--r--tests/auto/qxmlquery/tst_qxmlquery.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp
index be0d708..9a3d65d 100644
--- a/tests/auto/qxmlquery/tst_qxmlquery.cpp
+++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp
@@ -67,6 +67,9 @@
#if defined(Q_OS_SYMBIAN)
#define SRCDIR ""
+#define XMLPATTERNSDIR "xmlpatterns"
+#else
+#define XMLPATTERNSDIR SRCDIR "../xmlpatterns"
#endif
/*!
@@ -264,7 +267,7 @@ void tst_QXmlQuery::checkBaseURI(const QUrl &baseURI, const QString &candidate)
QVERIFY(QDir(baseURI.toLocalFile()).relativeFilePath(QFileInfo(candidate).canonicalFilePath()).startsWith("../"));
}
-const char *const tst_QXmlQuery::queriesDirectory = SRCDIR "../xmlpatterns/queries/";
+const char *const tst_QXmlQuery::queriesDirectory = XMLPATTERNSDIR "/queries/";
QStringList tst_QXmlQuery::queries()
{
@@ -857,7 +860,7 @@ void tst_QXmlQuery::bindVariableXSLTSuccess() const
stylesheet.bindVariable(QLatin1String("paramSelectWithTypeIntBoundWithBindVariableRequired"),
QVariant(QLatin1String("param5")));
- stylesheet.setQuery(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/parameters.xsl"))));
+ stylesheet.setQuery(QUrl(inputFile(QLatin1String(XMLPATTERNSDIR "/stylesheets/parameters.xsl"))));
QVERIFY(stylesheet.isValid());
@@ -1798,11 +1801,11 @@ void tst_QXmlQuery::setFocusQUrl() const
{
QXmlQuery query(QXmlQuery::XSLT20);
- const TestURIResolver resolver(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml"))));
+ const TestURIResolver resolver(QUrl(inputFile(QLatin1String(XMLPATTERNSDIR "/stylesheets/documentElement.xml"))));
query.setUriResolver(&resolver);
QVERIFY(query.setFocus(QUrl(QLatin1String("arbitraryURI"))));
- query.setQuery(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/copyWholeDocument.xsl"))));
+ query.setQuery(QUrl(inputFile(QLatin1String(XMLPATTERNSDIR "/stylesheets/copyWholeDocument.xsl"))));
QVERIFY(query.isValid());
QBuffer result;
@@ -2997,7 +3000,7 @@ void tst_QXmlQuery::setInitialTemplateNameQXmlName() const
QCOMPARE(query.initialTemplateName(), name);
- query.setQuery(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/namedTemplate.xsl"))));
+ query.setQuery(QUrl(inputFile(QLatin1String(XMLPATTERNSDIR "/stylesheets/namedTemplate.xsl"))));
QVERIFY(query.isValid());
QBuffer result;
@@ -3059,7 +3062,7 @@ void tst_QXmlQuery::setNetworkAccessManager() const
/* Ensure fn:doc() picks up the right QNetworkAccessManager. */
{
NetworkOverrider networkOverrider(QUrl(QLatin1String("tag:example.com:DOESNOTEXIST")),
- QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/queries/simpleDocument.xml"))));
+ QUrl(inputFile(QLatin1String(XMLPATTERNSDIR "/queries/simpleDocument.xml"))));
QXmlQuery query;
query.setNetworkAccessManager(&networkOverrider);
@@ -3075,7 +3078,7 @@ void tst_QXmlQuery::setNetworkAccessManager() const
/* Ensure setQuery() is using the right network manager. */
{
NetworkOverrider networkOverrider(QUrl(QLatin1String("tag:example.com:DOESNOTEXIST")),
- QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/queries/concat.xq"))));
+ QUrl(inputFile(QLatin1String(XMLPATTERNSDIR "/queries/concat.xq"))));
QXmlQuery query;
query.setNetworkAccessManager(&networkOverrider);
@@ -3133,9 +3136,9 @@ void tst_QXmlQuery::multipleDocsAndFocus() const
/* We use string concatenation, since variable bindings might disturb what
* we're testing. */
query.setQuery(QLatin1String("string(doc('") +
- inputFile(QLatin1String(SRCDIR "../xmlpatterns/queries/simpleDocument.xml")) +
+ inputFile(QLatin1String(XMLPATTERNSDIR "/queries/simpleDocument.xml")) +
QLatin1String("'))"));
- query.setFocus(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml"))));
+ query.setFocus(QUrl(inputFile(QLatin1String(XMLPATTERNSDIR "/stylesheets/documentElement.xml"))));
query.setQuery(QLatin1String("string(.)"));
QStringList result;
@@ -3159,11 +3162,11 @@ void tst_QXmlQuery::multipleEvaluationsWithDifferentFocus() const
QXmlQuery query;
QStringList result;
- query.setFocus(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml"))));
+ query.setFocus(QUrl(inputFile(QLatin1String(XMLPATTERNSDIR "/stylesheets/documentElement.xml"))));
query.setQuery(QLatin1String("string(.)"));
QVERIFY(query.evaluateTo(&result));
- query.setFocus(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml"))));
+ query.setFocus(QUrl(inputFile(QLatin1String(XMLPATTERNSDIR "/stylesheets/documentElement.xml"))));
QVERIFY(query.evaluateTo(&result));
}