summaryrefslogtreecommitdiffstats
path: root/tests/auto/qxmlstream/tst_qxmlstream.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-05-26 10:55:01 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-05-26 10:55:01 (GMT)
commit4837518d3161c77b4e811057d638dcbd22b89195 (patch)
treea0891fcaefa3ee627cace708b59a2a50180434da /tests/auto/qxmlstream/tst_qxmlstream.cpp
parent39b861b75566c4db0db3b5aba2aa191a59f10bdb (diff)
parent2eedb392048fdebbb29615345ea3716cebabd451 (diff)
downloadQt-4837518d3161c77b4e811057d638dcbd22b89195.zip
Qt-4837518d3161c77b4e811057d638dcbd22b89195.tar.gz
Qt-4837518d3161c77b4e811057d638dcbd22b89195.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: tst_qxmlstream: fix in shadowbuild QXmlStreamWriter: Auto-formatting does not behave properly with processing instructions. Update the state of the keyboard modifiers on drop events.
Diffstat (limited to 'tests/auto/qxmlstream/tst_qxmlstream.cpp')
-rw-r--r--tests/auto/qxmlstream/tst_qxmlstream.cpp26
1 files changed, 21 insertions, 5 deletions
diff --git a/tests/auto/qxmlstream/tst_qxmlstream.cpp b/tests/auto/qxmlstream/tst_qxmlstream.cpp
index 3c5358c..7d5e3b7 100644
--- a/tests/auto/qxmlstream/tst_qxmlstream.cpp
+++ b/tests/auto/qxmlstream/tst_qxmlstream.cpp
@@ -57,7 +57,7 @@
Q_DECLARE_METATYPE(QXmlStreamReader::ReadElementTextBehaviour)
-static const char *const catalogFile = "XML-Test-Suite/xmlconf/finalCatalog.xml";
+static const char *const catalogFile = SRCDIR "XML-Test-Suite/xmlconf/finalCatalog.xml";
static const int expectedRunCount = 1646;
static const int expectedSkipCount = 532;
@@ -527,8 +527,7 @@ class tst_QXmlStream: public QObject
{
Q_OBJECT
public:
- tst_QXmlStream() : m_handler(QUrl::fromLocalFile(QDir::currentPath() + QLatin1Char('/'))
- .resolved(QUrl(QLatin1String(catalogFile))))
+ tst_QXmlStream() : m_handler(QUrl::fromLocalFile(QLatin1String(catalogFile)))
{
}
@@ -546,6 +545,7 @@ private slots:
void writerHangs() const;
void writerAutoFormattingWithComments() const;
void writerAutoFormattingWithTabs() const;
+ void writerAutoFormattingWithProcessingInstructions() const;
void writerAutoEmptyTags() const;
void writeAttributesWithSpace() const;
void addExtraNamespaceDeclarations();
@@ -805,7 +805,7 @@ void tst_QXmlStream::testReader_data() const
QTest::addColumn<QString>("xml");
QTest::addColumn<QString>("ref");
QDir dir;
- dir.cd("data/");
+ dir.cd(SRCDIR "data/");
foreach(QString filename , dir.entryList(QStringList() << "*.xml")) {
QString reference = QFileInfo(filename).baseName() + ".ref";
QTest::newRow(dir.filePath(filename).toLatin1().data()) << dir.filePath(filename) << dir.filePath(reference);
@@ -1030,6 +1030,22 @@ void tst_QXmlStream::writerAutoFormattingWithTabs() const
QCOMPARE(buffer.buffer().data(), str);
}
+void tst_QXmlStream::writerAutoFormattingWithProcessingInstructions() const
+{
+ QBuffer buffer;
+ buffer.open(QIODevice::WriteOnly);
+
+ QXmlStreamWriter writer(&buffer);
+ writer.setAutoFormatting(true);
+ writer.writeStartDocument();
+ writer.writeProcessingInstruction("B", "C");
+ writer.writeStartElement("A");
+ writer.writeEndElement();
+ writer.writeEndDocument();
+ const char *str = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<?B C?>\n<A/>\n";
+ QCOMPARE(buffer.buffer().data(), str);
+}
+
/*!
Task 204822
*/
@@ -1184,7 +1200,7 @@ void tst_QXmlStream::crashInUTF16Codec() const
QEventLoop eventLoop;
QNetworkAccessManager networkManager;
- QNetworkRequest request(QUrl::fromLocalFile(QLatin1String("data/051reduced.xml")));
+ QNetworkRequest request(QUrl::fromLocalFile(QLatin1String(SRCDIR "data/051reduced.xml")));
QNetworkReply *const reply = networkManager.get(request);
eventLoop.connect(reply, SIGNAL(finished()), SLOT(quit()));