tests/auto/qxmlstream/tst_qxmlstream.cpp
branchGCC_SURGE
changeset 31 5daf16870df6
parent 23 89e065397ea6
child 33 3e2da88830cd
--- a/tests/auto/qxmlstream/tst_qxmlstream.cpp	Mon Jun 21 22:38:13 2010 +0100
+++ b/tests/auto/qxmlstream/tst_qxmlstream.cpp	Thu Jul 22 16:41:55 2010 +0100
@@ -569,6 +569,7 @@
     void clear() const;
     void checkCommentIndentation() const;
     void checkCommentIndentation_data() const;
+    void qtbug9196_crash() const;
 
 private:
     static QByteArray readFile(const QString &filename);
@@ -1528,5 +1529,16 @@
     QCOMPARE(output, expectedOutput);
 }
 
+void tst_QXmlStream::qtbug9196_crash() const
+{
+    // the following input used to produce a crash in the stream reader
+    QByteArray ba("<a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a>"
+                  "<a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a><a></a>");
+    QXmlStreamReader xml(ba);
+    while (!xml.atEnd()) {
+         xml.readNext();
+    }
+}
+
 #include "tst_qxmlstream.moc"
 // vim: et:ts=4:sw=4:sts=4