summaryrefslogtreecommitdiffstats
path: root/tests/auto/xml/sax
diff options
context:
space:
mode:
authorKurt Korbatits <kurt.korbatits@nokia.com>2012-01-18 12:32:58 +1000
committerQt by Nokia <qt-info@nokia.com>2012-01-19 04:45:29 +0100
commit3664d3b8426c05814cbf327ba010c5bec24853ef (patch)
treed8300ba30e61390f4c2c23fe95b9423406a5b426 /tests/auto/xml/sax
parent67a3698b3c558b5bd9fbd2e3b0121bab8c949c95 (diff)
Changed xml unittests to work from installation directory
- Changed to use QFINDTESTDATA and TESTDATA Change-Id: Ib738adfb6d0553e4c995ccaa51e34335f00f50f0 Reviewed-by: Kurt Korbatits <kurt.korbatits@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Diffstat (limited to 'tests/auto/xml/sax')
-rw-r--r--tests/auto/xml/sax/qxml/qxml.pro6
-rw-r--r--tests/auto/xml/sax/qxml/tst_qxml.cpp5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/qxmlsimplereader.pro6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp11
4 files changed, 16 insertions, 12 deletions
diff --git a/tests/auto/xml/sax/qxml/qxml.pro b/tests/auto/xml/sax/qxml/qxml.pro
index 4f2e427d14..e0b48ad9f5 100644
--- a/tests/auto/xml/sax/qxml/qxml.pro
+++ b/tests/auto/xml/sax/qxml/qxml.pro
@@ -4,8 +4,4 @@ TARGET = tst_qxml
SOURCES += tst_qxml.cpp
QT = core xml testlib
-wince* {
- addFiles.files = 0x010D.xml
- addFiles.path = .
- DEPLOYMENT += addFiles
-}
+TESTDATA += 0x010D.xml
diff --git a/tests/auto/xml/sax/qxml/tst_qxml.cpp b/tests/auto/xml/sax/qxml/tst_qxml.cpp
index afe219c635..14f4e554aa 100644
--- a/tests/auto/xml/sax/qxml/tst_qxml.cpp
+++ b/tests/auto/xml/sax/qxml/tst_qxml.cpp
@@ -196,7 +196,10 @@ void tst_QXml::interpretedAs0D() const
QChar(0x010D) +
QLatin1String("reated-by=\"an attr value\"/>"));
- QFile f("0x010D.xml");
+ QString testFile = QFINDTESTDATA("0x010D.xml");
+ if (testFile.isEmpty())
+ QFAIL("Cannot find test file 0x010D.xml!");
+ QFile f(testFile);
QVERIFY(f.open(QIODevice::ReadOnly));
QXmlInputSource data(&f);
diff --git a/tests/auto/xml/sax/qxmlsimplereader/qxmlsimplereader.pro b/tests/auto/xml/sax/qxmlsimplereader/qxmlsimplereader.pro
index ae924ca35f..cec33ded18 100644
--- a/tests/auto/xml/sax/qxmlsimplereader/qxmlsimplereader.pro
+++ b/tests/auto/xml/sax/qxmlsimplereader/qxmlsimplereader.pro
@@ -12,8 +12,4 @@ CONFIG += no_batch
QT += network xml testlib
QT -= gui
-wince* {
- addFiles.files = encodings parser xmldocs
- addFiles.path = .
- DEPLOYMENT += addFiles
-}
+TESTDATA += encodings/* xmldocs/*
diff --git a/tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp b/tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp
index 1478ae7e23..8001c199e4 100644
--- a/tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp
+++ b/tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp
@@ -141,7 +141,7 @@ class tst_QXmlSimpleReader : public QObject
~tst_QXmlSimpleReader();
private slots:
-
+ void initTestCase();
void testGoodXmlFile();
void testGoodXmlFile_data();
void testBadXmlFile();
@@ -164,6 +164,7 @@ class tst_QXmlSimpleReader : public QObject
private:
static QDomDocument fromByteArray(const QString &title, const QByteArray &ba, bool *ok);
XmlServer *server;
+ QString prefix;
};
tst_QXmlSimpleReader::tst_QXmlSimpleReader()
@@ -210,6 +211,14 @@ public:
};
+void tst_QXmlSimpleReader::initTestCase()
+{
+ prefix = QFileInfo(QFINDTESTDATA("xmldocs")).absolutePath();
+ if (prefix.isEmpty())
+ QFAIL("Cannot find xmldocs testdata!");
+ QDir::setCurrent(prefix);
+}
+
void tst_QXmlSimpleReader::idsInParseException1()
{
MyErrorHandler handler;