diff options
author | Kai Pastor <dg0yt@darc.de> | 2016-04-02 10:03:54 +0200 |
---|---|---|
committer | Kai Pastor <dg0yt@darc.de> | 2016-04-12 19:18:33 +0000 |
commit | ed2d5b7f44f9d0a25aa185d3843ee14366ffef7c (patch) | |
tree | 8e131dbc477d3ba19a3a6b46e10075d507da2c75 /tests/auto/linguist/lupdate | |
parent | b2bede961d73ecc253f9bf6c61ccf3b5a8c12cb3 (diff) | |
download | qttools-ed2d5b7f44f9d0a25aa185d3843ee14366ffef7c.tar.gz |
lupdate: Treat NULL and Q_NULLPTR like literal 0
Task-number: QTBUG-34265
Change-Id: I2b69d7c6bc0514977cee9dd50a0c861e46dc589b
Reviewed-by: Rolf Eike Beer <eb@emlix.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'tests/auto/linguist/lupdate')
-rw-r--r-- | tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp | 9 | ||||
-rw-r--r-- | tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result | 14 |
2 files changed, 23 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 d58ddf9fb..31783fd6a 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp @@ -507,3 +507,12 @@ class nullptrClass : public QObject tr("%n car(s)", nullptr, 2); } }; + + + +// QTBUG-34265: lupdate does not detect NULL and Q_NULLPTR as 0 when being passed as context +void nullMacroInPlural() +{ + QObject::tr("%n NULL(s)", NULL, 3); + QObject::tr("%n Q_NULLPTR(s)", Q_NULLPTR, 3); +} 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 be9df15ca..4f301b2db 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result @@ -319,6 +319,20 @@ backslashed \ stuff.</source> <numerusform></numerusform> </translation> </message> + <message numerus="yes"> + <location filename="main.cpp" line="516"/> + <source>%n NULL(s)</source> + <translation type="unfinished"> + <numerusform></numerusform> + </translation> + </message> + <message numerus="yes"> + <location filename="main.cpp" line="517"/> + <source>%n Q_NULLPTR(s)</source> + <translation type="unfinished"> + <numerusform></numerusform> + </translation> + </message> <message> <location filename="included.cpp" line="34"/> <source>message from #included .cpp file</source> |