diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp | 33 | ||||
-rw-r--r-- | tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result | 33 | ||||
-rw-r--r-- | tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qhelpenginecore/data/collection.qhc | bin | 10240 -> 10240 bytes | |||
-rw-r--r-- | tests/auto/qhelpenginecore/data/collection1.qhc | bin | 10240 -> 10240 bytes | |||
-rw-r--r-- | tests/auto/qhelpenginecore/tst_qhelpenginecore.cpp | 10 | ||||
-rw-r--r-- | tests/auto/qhelpgenerator/qhelpgenerator.pro | 4 | ||||
-rw-r--r-- | tests/auto/qhelpgenerator/tst_qhelpgenerator.cpp | 10 | ||||
-rw-r--r-- | tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp | 6 |
9 files changed, 84 insertions, 16 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp index 1bc1dc2a2..d93f1bb1f 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp @@ -655,3 +655,36 @@ QString unicodeEscape() { return QApplication::tr("Context", "soft\u00ADhyphen"); } + + + +// QTBUG-63364: C++17 nested namespaces +namespace Outer::Inner { + +class Class +{ + Q_OBJECT + void function() + { + tr("MoreFunStuff!"); + } +}; + +} + + + +// test of translation for _N_ family +static const char * const test_string_n1[] = { + QT_TRANSLATE_N_NOOP("scope", "string %n") +}; + +static const char * const test_string_n2[] = { + QT_TRANSLATE_N_NOOP3("scope", "string %n", "comment"); +}; +class testing { + Q_OBJECT + static const char * const test_string_n3[] = { + QT_TR_N_NOOP("%n test"); + }; +}; diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result index c344667cf..7c500f6a3 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result @@ -251,6 +251,14 @@ backslashed \ stuff.</source> </message> </context> <context> + <name>Outer::Inner::Class</name> + <message> + <location filename="main.cpp" line="669"/> + <source>MoreFunStuff!</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>Plurals, QCoreApplication</name> <message numerus="yes"> <location filename="main.cpp" line="68"/> @@ -625,5 +633,30 @@ backslashed \ stuff.</source> <source>string continuation on next line</source> <translation type="unfinished"></translation> </message> + <message numerus="yes"> + <location filename="main.cpp" line="679"/> + <source>string %n</source> + <translation type="unfinished"> + <numerusform></numerusform> + </translation> + </message> + <message numerus="yes"> + <location filename="main.cpp" line="683"/> + <source>string %n</source> + <comment>comment</comment> + <translation type="unfinished"> + <numerusform></numerusform> + </translation> + </message> +</context> +<context> + <name>testing</name> + <message numerus="yes"> + <location filename="main.cpp" line="688"/> + <source>%n test</source> + <translation type="unfinished"> + <numerusform></numerusform> + </translation> + </message> </context> </TS> diff --git a/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.cpp b/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.cpp index 63ee55cbc..039ea2f9a 100644 --- a/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.cpp +++ b/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.cpp @@ -135,7 +135,7 @@ void tst_QHelpContentModel::contentItemAt() QCOMPARE(h.currentFilter(), QString("unfiltered")); - QModelIndex root = m->index(0, 0); + QModelIndex root = m->index(2, 0); if (!root.isValid()) QFAIL("Cannot retrieve root item!"); QHelpContentItem *item = m->contentItemAt(root); @@ -146,7 +146,7 @@ void tst_QHelpContentModel::contentItemAt() item = m->contentItemAt(m->index(4, 0, root)); QCOMPARE(item->title(), QString("qmake Concepts")); - item = m->contentItemAt(m->index(3, 0)); + item = m->contentItemAt(m->index(0, 0)); QCOMPARE(item->title(), QString("Fancy Manual")); w.start(); diff --git a/tests/auto/qhelpenginecore/data/collection.qhc b/tests/auto/qhelpenginecore/data/collection.qhc Binary files differindex bd2f37c17..cc405f2ed 100644 --- a/tests/auto/qhelpenginecore/data/collection.qhc +++ b/tests/auto/qhelpenginecore/data/collection.qhc diff --git a/tests/auto/qhelpenginecore/data/collection1.qhc b/tests/auto/qhelpenginecore/data/collection1.qhc Binary files differindex de310ea24..85f4f8fd8 100644 --- a/tests/auto/qhelpenginecore/data/collection1.qhc +++ b/tests/auto/qhelpenginecore/data/collection1.qhc diff --git a/tests/auto/qhelpenginecore/tst_qhelpenginecore.cpp b/tests/auto/qhelpenginecore/tst_qhelpenginecore.cpp index 479325082..ba2b1532d 100644 --- a/tests/auto/qhelpenginecore/tst_qhelpenginecore.cpp +++ b/tests/auto/qhelpenginecore/tst_qhelpenginecore.cpp @@ -117,7 +117,7 @@ void tst_QHelpEngineCore::setCollectionFile() QStringList docs = help.registeredDocumentations(); QCOMPARE(docs.count(), 1); - QCOMPARE(docs.first(), QLatin1String("trolltech.com.1-0-0.test")); + QCOMPARE(docs.first(), QLatin1String("trolltech.com.1.0.0.test")); } void tst_QHelpEngineCore::copyCollectionFile() @@ -193,7 +193,7 @@ void tst_QHelpEngineCore::registeredDocumentations() QCOMPARE(docs.count(), 3); QStringList lst; lst << "trolltech.com.3-3-8.qmake" << "trolltech.com.4-3-0.qmake" - << "trolltech.com.1-0-0.test"; + << "trolltech.com.1.0.0.test"; foreach (QString s, docs) lst.removeAll(s); QCOMPARE(lst.isEmpty(), true); @@ -249,7 +249,7 @@ void tst_QHelpEngineCore::documentationFileName() QCOMPARE(c.setupData(), true); QCOMPARE(c.documentationFileName(QLatin1String("trolltech.com.3-3-8.qmake")), QString(m_path + "/data/qmake-3.3.8.qch")); - QCOMPARE(c.documentationFileName(QLatin1String("trolltech.com.1-0-0.test")), + QCOMPARE(c.documentationFileName(QLatin1String("trolltech.com.1.0.0.test")), QString(m_path + "/data/test.qch")); QCOMPARE(c.documentationFileName(QLatin1String("trolltech.com.empty")), QString()); @@ -324,7 +324,7 @@ void tst_QHelpEngineCore::filterAttributeSets() { QHelpEngineCore help(m_colFile, 0); QCOMPARE(help.setupData(), true); - QList<QStringList> lst = help.filterAttributeSets("trolltech.com.1-0-0.test"); + QList<QStringList> lst = help.filterAttributeSets("trolltech.com.1.0.0.test"); QCOMPARE(lst.count(), 2); QCOMPARE(lst.first().count(), 2); QCOMPARE((bool)lst.first().contains("filter1"), true); @@ -365,7 +365,7 @@ void tst_QHelpEngineCore::fileData() QCOMPARE(help.setupData(), true); QByteArray ba = help.fileData(QUrl("NotExisting")); QCOMPARE(ba.size(), 0); - ba = help.fileData(QUrl("qthelp://trolltech.com.1-0-0.test/testFolder/test.html")); + ba = help.fileData(QUrl("qthelp://trolltech.com.1.0.0.test/testFolder/test.html")); QTextStream s(ba, QIODevice::ReadOnly|QIODevice::Text); QFile f(m_path + "/data/test.html"); if (!f.open(QIODevice::ReadOnly|QIODevice::Text)) diff --git a/tests/auto/qhelpgenerator/qhelpgenerator.pro b/tests/auto/qhelpgenerator/qhelpgenerator.pro index 9134f53b3..06bc1c631 100644 --- a/tests/auto/qhelpgenerator/qhelpgenerator.pro +++ b/tests/auto/qhelpgenerator/qhelpgenerator.pro @@ -1,7 +1,9 @@ TARGET = tst_qhelpgenerator CONFIG += testcase -SOURCES += tst_qhelpgenerator.cpp +HEADERS += ../../../src/assistant/shared/helpgenerator.h +SOURCES += tst_qhelpgenerator.cpp \ + ../../../src/assistant/shared/helpgenerator.cpp QT += help-private sql testlib DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/qhelpgenerator/tst_qhelpgenerator.cpp b/tests/auto/qhelpgenerator/tst_qhelpgenerator.cpp index 10cfff9ac..b5ecc5118 100644 --- a/tests/auto/qhelpgenerator/tst_qhelpgenerator.cpp +++ b/tests/auto/qhelpgenerator/tst_qhelpgenerator.cpp @@ -31,8 +31,8 @@ #include <QtSql/QSqlDatabase> #include <QtSql/QSqlQuery> -#include <QtHelp/private/qhelpgenerator_p.h> #include <QtHelp/private/qhelpprojectdata_p.h> +#include "../../../src/assistant/shared/helpgenerator.h" class tst_QHelpGenerator : public QObject { @@ -76,7 +76,7 @@ void tst_QHelpGenerator::generateHelp() if (!data.readData(inputFile)) QFAIL("Cannot read qthp file!"); - QHelpGenerator generator; + HelpGenerator generator; QCOMPARE(generator.generate(&data, m_outputFile), true); { @@ -182,7 +182,7 @@ void tst_QHelpGenerator::checkMetaData() m_query->exec("SELECT COUNT(Value) FROM MetaDataTable"); if (!m_query->next()) QFAIL("Meta Data Error"); - QCOMPARE(m_query->value(0).toInt(), 4); + QCOMPARE(m_query->value(0).toInt(), 3); m_query->exec("SELECT Value FROM MetaDataTable WHERE Name=\'author\'"); if (!m_query->next()) @@ -201,8 +201,8 @@ void tst_QHelpGenerator::generateTwice() if (!data.readData(inputFile)) QFAIL("Cannot read qhp file!"); - QHelpGenerator generator1; - QHelpGenerator generator2; + HelpGenerator generator1; + HelpGenerator generator2; QString outputFile1 = path + QLatin1String("/data/test1.qch"); QString outputFile2 = path + QLatin1String("/data/test2.qch"); QCOMPARE(generator1.generate(&data, outputFile1), true); diff --git a/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp b/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp index 494355c5d..713c229ce 100644 --- a/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp +++ b/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp @@ -170,11 +170,11 @@ void tst_QHelpIndexModel::linksForIndex() QCOMPARE(map.count(), 2); QCOMPARE(map.contains("Test Manual"), true); QCOMPARE(map.value("Test Manual"), - QUrl("qthelp://trolltech.com.1.0.0.test/testFolder/test.html#foo")); + QUrl("qthelp://trolltech.com.1-0-0.test/testFolder/test.html#foo")); QCOMPARE(map.contains("Fancy"), true); QCOMPARE(map.value("Fancy"), - QUrl("qthelp://trolltech.com.1.0.0.test/testFolder/fancy.html#foo")); + QUrl("qthelp://trolltech.com.1-0-0.test/testFolder/fancy.html#foo")); map = m->linksForKeyword("foobar"); QCOMPARE(map.count(), 1); @@ -193,7 +193,7 @@ void tst_QHelpIndexModel::linksForIndex() QCOMPARE(map.count(), 1); QCOMPARE(map.contains("Test Manual"), true); QCOMPARE(map.value("Test Manual"), - QUrl("qthelp://trolltech.com.1.0.0.test/testFolder/test.html#foo")); + QUrl("qthelp://trolltech.com.1-0-0.test/testFolder/test.html#foo")); } QTEST_MAIN(tst_QHelpIndexModel) |