summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qxmlstream/tst_qxmlstream.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qxmlstream/tst_qxmlstream.cpp b/tests/auto/qxmlstream/tst_qxmlstream.cpp
index 3c5358c36c..f93d4fc6d1 100644
--- a/tests/auto/qxmlstream/tst_qxmlstream.cpp
+++ b/tests/auto/qxmlstream/tst_qxmlstream.cpp
@@ -546,6 +546,7 @@ private slots:
void writerHangs() const;
void writerAutoFormattingWithComments() const;
void writerAutoFormattingWithTabs() const;
+ void writerAutoFormattingWithProcessingInstructions() const;
void writerAutoEmptyTags() const;
void writeAttributesWithSpace() const;
void addExtraNamespaceDeclarations();
@@ -1030,6 +1031,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
*/