diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2013-08-01 12:05:47 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-06 09:30:36 +0200 |
commit | a4e8dca0c3665a26ff5e7dffada97aeab86dd1a5 (patch) | |
tree | b3d7c20c44f40ccc018dc6f33ff1b4f443f3cffd /tests/auto/linguist/lupdate/testdata | |
parent | 9577e0134f6999f7e4f569344982f071e9cc37ff (diff) | |
download | qttools-a4e8dca0c3665a26ff5e7dffada97aeab86dd1a5.tar.gz |
avoid false positives when looking for magic comments
expect meta data only at the beginning of statements.
this required syntax fixes in some unrelated autotests.
Task-number: QTBUG-11866
Change-Id: Ic0c0c150ac8648df6953a510b8eb0c199c8d3ae2
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'tests/auto/linguist/lupdate/testdata')
4 files changed, 19 insertions, 7 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/multiple_locations/finddialog.cpp b/tests/auto/linguist/lupdate/testdata/good/multiple_locations/finddialog.cpp index 15f3ad464..cd9a64a1f 100644 --- a/tests/auto/linguist/lupdate/testdata/good/multiple_locations/finddialog.cpp +++ b/tests/auto/linguist/lupdate/testdata/good/multiple_locations/finddialog.cpp @@ -39,9 +39,9 @@ ** ****************************************************************************/ -QT_TRANSLATE_NOOP("context", "just a message") +QT_TRANSLATE_NOOP("context", "just a message"); //: This is one comment -QT_TRANSLATE_NOOP("context", "just a message") +QT_TRANSLATE_NOOP("context", "just a message"); diff --git a/tests/auto/linguist/lupdate/testdata/good/multiple_locations/main.cpp b/tests/auto/linguist/lupdate/testdata/good/multiple_locations/main.cpp index b501ff22a..d06e8b2ca 100644 --- a/tests/auto/linguist/lupdate/testdata/good/multiple_locations/main.cpp +++ b/tests/auto/linguist/lupdate/testdata/good/multiple_locations/main.cpp @@ -43,7 +43,7 @@ //: This is a comment, too. -QT_TRANSLATE_NOOP("context", "just a message") +QT_TRANSLATE_NOOP("context", "just a message"); diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp index 04e3b1442..bbd29e3b5 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp @@ -191,12 +191,12 @@ class Testing : QObject { //: extra comment for NOOP //: which spans multiple lines -QT_TRANSLATE_NOOP("scope", "string") // 4.4 says the line of this is at the next statement +QT_TRANSLATE_NOOP("scope", "string") /*: complain & ignore */; // 4.4 says the line of this is at the next statement //: extra comment for NOOP3 -QT_TRANSLATE_NOOP3_UTF8("scope", "string", "comment") // 4.4 doesn't see this +QT_TRANSLATE_NOOP3_UTF8("scope", "string", "comment"); // 4.4 doesn't see this QT_TRANSLATE_NOOP("scope", "string " // this is an interleaved comment - "continuation on next line") + "continuation on next line"); class TestingTake17 : QObject { @@ -223,7 +223,7 @@ class TestingTake17 : QObject { //: again an extra comment, this time for id-based NOOP //% "This is supposed\tto be quoted \" newline\n" //% "backslashed \\ stuff." -QT_TRID_NOOP("this_a_id") +QT_TRID_NOOP("this_a_id"); //~ some thing //% "This needs to be here. Really." @@ -387,3 +387,10 @@ Class42::Class42() : { tr("and does that?"); } + + + +// QTBUG-11866: magic comment parsing is too greedy +Class42::hello(int something /*= 17 */, QString str = Class42::tr("eyo")) +{ +} 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 bea844593..83eb95eba 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result @@ -46,6 +46,11 @@ backslashed \ stuff.</source> <source>and does that?</source> <translation type="unfinished"></translation> </message> + <message> + <location filename="main.cpp" line="394"/> + <source>eyo</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>Dialog2</name> |