summaryrefslogtreecommitdiffstats
path: root/tests/auto/qdom/tst_qdom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qdom/tst_qdom.cpp')
-rw-r--r--tests/auto/qdom/tst_qdom.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qdom/tst_qdom.cpp b/tests/auto/qdom/tst_qdom.cpp
index 0cad45e..e06ef21 100644
--- a/tests/auto/qdom/tst_qdom.cpp
+++ b/tests/auto/qdom/tst_qdom.cpp
@@ -126,6 +126,8 @@ private slots:
void setContentWhitespace() const;
void setContentWhitespace_data() const;
+ void taskQTBUG4595_dontAssertWhenDocumentSpecifiesUnknownEncoding() const;
+
void cleanupTestCase() const;
private:
@@ -1893,5 +1895,18 @@ void tst_QDom::setContentWhitespace_data() const
QTest::newRow("") << QString::fromLatin1("\t\t\t\t<?xml version='1.0' ?><e/>") << false;
}
+void tst_QDom::taskQTBUG4595_dontAssertWhenDocumentSpecifiesUnknownEncoding() const
+{
+ QString xmlWithUnknownEncoding("<?xml version='1.0' encoding='unknown-encoding'?>"
+ "<foo>"
+ " <bar>How will this sentence be handled?</bar>"
+ "</foo>");
+ QDomDocument d;
+ QVERIFY(d.setContent(xmlWithUnknownEncoding));
+
+ QString dontAssert = d.toString(); // this should not assert
+ QVERIFY(true);
+}
+
QTEST_MAIN(tst_QDom)
#include "tst_qdom.moc"