summaryrefslogtreecommitdiffstats
path: root/tests/auto/xml/dom/qdom/tst_qdom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/xml/dom/qdom/tst_qdom.cpp')
-rw-r--r--tests/auto/xml/dom/qdom/tst_qdom.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/xml/dom/qdom/tst_qdom.cpp b/tests/auto/xml/dom/qdom/tst_qdom.cpp
index a4a3f1f6b3..04cd0b300f 100644
--- a/tests/auto/xml/dom/qdom/tst_qdom.cpp
+++ b/tests/auto/xml/dom/qdom/tst_qdom.cpp
@@ -119,6 +119,7 @@ private slots:
void cloneDTD_QTBUG8398() const;
void DTDNotationDecl();
void DTDEntityDecl();
+ void QTBUG49113_dontCrashWithNegativeIndex() const;
void cleanupTestCase() const;
@@ -1979,5 +1980,13 @@ void tst_QDom::DTDEntityDecl()
QCOMPARE(doctype.namedItem(QString("logo")).toEntity().notationName(), QString("gif"));
}
+void tst_QDom::QTBUG49113_dontCrashWithNegativeIndex() const
+{
+ QDomDocument doc;
+ QDomElement elem = doc.appendChild(doc.createElement("root")).toElement();
+ QDomNode node = elem.attributes().item(-1);
+ QVERIFY(node.isNull());
+}
+
QTEST_MAIN(tst_QDom)
#include "tst_qdom.moc"