diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/linguist/lupdate/testdata/good/namespaces/main.cpp | 60 | ||||
-rw-r--r-- | tests/auto/linguist/lupdate/testdata/good/namespaces/project.ts.result | 24 | ||||
-rw-r--r-- | tests/auto/qdom/tst_qdom.cpp | 25 |
3 files changed, 109 insertions, 0 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/namespaces/main.cpp b/tests/auto/linguist/lupdate/testdata/good/namespaces/main.cpp index 42cc55b..a5b36ca 100644 --- a/tests/auto/linguist/lupdate/testdata/good/namespaces/main.cpp +++ b/tests/auto/linguist/lupdate/testdata/good/namespaces/main.cpp @@ -135,4 +135,64 @@ Q_OBJECT } }; +// QTBUG-8360 +namespace A { + +void foo() +{ + using namespace A; +} + +void goo() +{ + return QObject::tr("Bla"); +} + +} + + +namespace AA { +namespace B { + +using namespace AA; + +namespace C { + +class Test : public QObject { + Q_OBJECT +}; + +} + +} + +using namespace B; +using namespace C; + +void goo() +{ + AA::Test::tr("howdy?"); +} + +} + + +namespace A1 { +namespace B { + +class Test : public QObject { + Q_OBJECT +}; + +using namespace A1; + +void foo() +{ + B::B::B::Test::tr("yeeee-ha!"); +} + +} +} + + #include "main.moc" diff --git a/tests/auto/linguist/lupdate/testdata/good/namespaces/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/namespaces/project.ts.result index c1a34bd..94df9d3 100644 --- a/tests/auto/linguist/lupdate/testdata/good/namespaces/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/namespaces/project.ts.result @@ -2,6 +2,22 @@ <!DOCTYPE TS> <TS version="2.0"> <context> + <name>A1::B::Test</name> + <message> + <location filename="main.cpp" line="191"/> + <source>yeeee-ha!</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>AA::B::C::Test</name> + <message> + <location filename="main.cpp" line="174"/> + <source>howdy?</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>Class</name> <message> <location filename="main.cpp" line="52"/> @@ -79,4 +95,12 @@ <translation type="unfinished"></translation> </message> </context> +<context> + <name>QObject</name> + <message> + <location filename="main.cpp" line="148"/> + <source>Bla</source> + <translation type="unfinished"></translation> + </message> +</context> </TS> diff --git a/tests/auto/qdom/tst_qdom.cpp b/tests/auto/qdom/tst_qdom.cpp index d1b2ea5..caf08d6 100644 --- a/tests/auto/qdom/tst_qdom.cpp +++ b/tests/auto/qdom/tst_qdom.cpp @@ -131,6 +131,7 @@ private slots: void setContentWhitespace_data() const; void taskQTBUG4595_dontAssertWhenDocumentSpecifiesUnknownEncoding() const; + void cloneDTD_QTBUG8398() const; void cleanupTestCase() const; @@ -1912,5 +1913,29 @@ void tst_QDom::taskQTBUG4595_dontAssertWhenDocumentSpecifiesUnknownEncoding() co QVERIFY(true); } +void tst_QDom::cloneDTD_QTBUG8398() const +{ + QString dtd("<?xml version='1.0' encoding='UTF-8'?>\n" + "<!DOCTYPE first [\n" + "<!ENTITY secondFile SYSTEM 'second.xml'>\n" + "<!ENTITY thirdFile SYSTEM 'third.xml'>\n" + "]>\n" + "<first/>\n"); + QDomDocument domDocument; + QVERIFY(domDocument.setContent(dtd)); + QDomDocument domDocument2 = domDocument.cloneNode(true).toDocument(); + + // for some reason, our DOM implementation reverts the order of entities + QString expected("<?xml version='1.0' encoding='UTF-8'?>\n" + "<!DOCTYPE first [\n" + "<!ENTITY thirdFile SYSTEM 'third.xml'>\n" + "<!ENTITY secondFile SYSTEM 'second.xml'>\n" + "]>\n" + "<first/>\n"); + QString output; + QTextStream stream(&output); + domDocument2.save(stream, 0); + QCOMPARE(output, expected); +} QTEST_MAIN(tst_QDom) #include "tst_qdom.moc" |