tests/auto/qxmlstream/tst_qxmlstream.cpp
changeset 23 89e065397ea6
parent 18 2f34d5167611
child 33 3e2da88830cd
--- a/tests/auto/qxmlstream/tst_qxmlstream.cpp	Fri May 14 16:40:13 2010 +0300
+++ b/tests/auto/qxmlstream/tst_qxmlstream.cpp	Thu May 27 13:40:48 2010 +0300
@@ -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