equal
deleted
inserted
replaced
1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the test suite of the Qt Toolkit. |
7 ** This file is part of the test suite of the Qt Toolkit. |
8 ** |
8 ** |
129 void checkIntOverflow() const; |
129 void checkIntOverflow() const; |
130 void setContentWhitespace() const; |
130 void setContentWhitespace() const; |
131 void setContentWhitespace_data() const; |
131 void setContentWhitespace_data() const; |
132 |
132 |
133 void taskQTBUG4595_dontAssertWhenDocumentSpecifiesUnknownEncoding() const; |
133 void taskQTBUG4595_dontAssertWhenDocumentSpecifiesUnknownEncoding() const; |
|
134 void cloneDTD_QTBUG8398() const; |
134 |
135 |
135 void cleanupTestCase() const; |
136 void cleanupTestCase() const; |
136 |
137 |
137 private: |
138 private: |
138 static QDomDocument generateRequest(); |
139 static QDomDocument generateRequest(); |
1910 |
1911 |
1911 QString dontAssert = d.toString(); // this should not assert |
1912 QString dontAssert = d.toString(); // this should not assert |
1912 QVERIFY(true); |
1913 QVERIFY(true); |
1913 } |
1914 } |
1914 |
1915 |
|
1916 void tst_QDom::cloneDTD_QTBUG8398() const |
|
1917 { |
|
1918 QString dtd("<?xml version='1.0' encoding='UTF-8'?>\n" |
|
1919 "<!DOCTYPE first [\n" |
|
1920 "<!ENTITY secondFile SYSTEM 'second.xml'>\n" |
|
1921 "<!ENTITY thirdFile SYSTEM 'third.xml'>\n" |
|
1922 "]>\n" |
|
1923 "<first/>\n"); |
|
1924 QDomDocument domDocument; |
|
1925 QVERIFY(domDocument.setContent(dtd)); |
|
1926 QDomDocument domDocument2 = domDocument.cloneNode(true).toDocument(); |
|
1927 |
|
1928 // for some reason, our DOM implementation reverts the order of entities |
|
1929 QString expected("<?xml version='1.0' encoding='UTF-8'?>\n" |
|
1930 "<!DOCTYPE first [\n" |
|
1931 "<!ENTITY thirdFile SYSTEM 'third.xml'>\n" |
|
1932 "<!ENTITY secondFile SYSTEM 'second.xml'>\n" |
|
1933 "]>\n" |
|
1934 "<first/>\n"); |
|
1935 QString output; |
|
1936 QTextStream stream(&output); |
|
1937 domDocument2.save(stream, 0); |
|
1938 QCOMPARE(output, expected); |
|
1939 } |
1915 QTEST_MAIN(tst_QDom) |
1940 QTEST_MAIN(tst_QDom) |
1916 #include "tst_qdom.moc" |
1941 #include "tst_qdom.moc" |