diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-01-21 08:39:56 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-01-21 08:40:07 +0100 |
commit | 9514b6c9de0f44f55fb231a3ac0054bc1782ac1d (patch) | |
tree | 72300d57ea300b5c13726ecf6fe11c5743423e8c /tests | |
parent | 92a9378328884471861efb117207147cdf201333 (diff) | |
parent | 2b8b119290d7b453cd1c5ef8ee62bf653eaffbb0 (diff) | |
download | qttools-9514b6c9de0f44f55fb231a3ac0054bc1782ac1d.tar.gz |
Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: Ie5e9e73a136892cbd02498cca7cd782b50187ddf
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp | 78 | ||||
-rw-r--r-- | tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result | 70 |
2 files changed, 148 insertions, 0 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp index 8b91a7761..f4ac1e214 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp @@ -410,3 +410,81 @@ int dupeFail() // Finally, same source, but without ID. QCoreApplication::translate("", "This is the source"); } + + + +// QTBUG-42735: lupdate confused by `final` specifier (C++11) +namespace Abc { + +class NamespacedFinalClass; + +} + +class FinalClass final : public QObject +{ + Q_OBJECT + + class SubClass final + { + void f() + { + tr("nested class context with final"); + } + }; + + void f() + { + tr("class context with final"); + } +}; + +class Abc::NamespacedFinalClass final : public QObject +{ + Q_OBJECT + + void f() + { + tr("namespaced class with final"); + } +}; + + + +// QTBUG-48776: lupdate fails to recognize translator comment in ternary +// operator construct +void ternary() +{ + const auto aaa = + obj.condition ? + //: comment, aaa, true + QObject::tr("ternary, true, aaa") : + QObject::tr("ternary, failure, aaa"); + + const auto bbb = + obj.condition ? + //: comment, bbb, true + QObject::tr("ternary, bbb, true") : + //: comment, bbb, false + QObject::tr("ternary, bbb, false"); +} + +class TernaryClass : public QObject +{ + Q_OBJECT + + void f() + { + const auto ccc = + obj.condition ? + //: comment, ccc, true + tr("ternary, ccc, true") : + tr("ternary, ccc, false"); + + const auto ddd = + obj.condition ? + //: comment, ddd, true + tr("ternary, ddd, true") : + //: comment, ddd, false + tr("ternary, ddd, false"); + } +}; 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 0c0c1b511..b847f8f89 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result @@ -33,6 +33,14 @@ backslashed \ stuff.</source> </message> </context> <context> + <name>Abc::NamespacedFinalClass</name> + <message> + <location filename="main.cpp" line="447"/> + <source>namespaced class with final</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>Bogus</name> <message> <location filename="main.cpp" line="258"/> @@ -117,6 +125,19 @@ backslashed \ stuff.</source> </message> </context> <context> + <name>FinalClass</name> + <message> + <location filename="main.cpp" line="431"/> + <source>nested class context with final</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="main.cpp" line="437"/> + <source>class context with final</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>FindDialog</name> <message> <location filename="finddialog.cpp" line="77"/> @@ -259,6 +280,29 @@ backslashed \ stuff.</source> <translation type="unfinished"></translation> </message> <message> + <location filename="main.cpp" line="460"/> + <source>ternary, true, aaa</source> + <extracomment>comment, aaa, true</extracomment> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="main.cpp" line="461"/> + <source>ternary, failure, aaa</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="main.cpp" line="466"/> + <source>ternary, bbb, true</source> + <extracomment>comment, bbb, true</extracomment> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="main.cpp" line="468"/> + <source>ternary, bbb, false</source> + <extracomment>comment, bbb, false</extracomment> + <translation type="unfinished"></translation> + </message> + <message> <location filename="included.cpp" line="34"/> <source>message from #included .cpp file</source> <translation type="unfinished"></translation> @@ -311,6 +355,32 @@ backslashed \ stuff.</source> </message> </context> <context> + <name>TernaryClass</name> + <message> + <location filename="main.cpp" line="480"/> + <source>ternary, ccc, true</source> + <extracomment>comment, ccc, true</extracomment> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="main.cpp" line="481"/> + <source>ternary, ccc, false</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="main.cpp" line="486"/> + <source>ternary, ddd, true</source> + <extracomment>comment, ddd, true</extracomment> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="main.cpp" line="488"/> + <source>ternary, ddd, false</source> + <extracomment>comment, ddd, false</extracomment> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>TestClass</name> <message> <location filename="main.cpp" line="149"/> |